import{_ as C}from"./NoDataFound-bc81d7fa.js";import B from"./OverviewGrid-21ea6fc2.js";import{_ as T}from"./Paginate-f61b79b2.js";import{s as $,p as a,h as f,c as o,a as d,b as s,t as e,u as n,F as N,r as U,i as V,g as I,o as l,j as L,k as P,e as g,n as j}from"./app-13978987.js";import{_ as z}from"./AdminLayout-bd13ff9d.js";import{_ as A}from"./PageHeader-8c638686.js";import"./dropdown-45d66330.js";const D={class:"container flex-grow p-4 sm:p-6"},F={class:"space-y-6"},S={class:"table-responsive whitespace-nowrap rounded-primary"},E={class:"table"},M={class:"text-right"},O={key:0},R={key:0,class:"flex items-center gap-3"},q=["src"],G={key:0,class:"badge badge-secondary"},H={class:"dropdown","data-placement":"bottom-start"},J={class:"dropdown-toggle"},K={class:"dropdown-content w-40"},Q={class:"dropdown-list"},W={class:"dropdown-list-item"},X=["onClick"],Y=I({layout:z}),ds=Object.assign(Y,{__name:"Index",props:["posts","countTotal","countUnpublished","countPublished"],setup(i){const r=i,{deleteRow:k,uiAvatar:v}=$(),y=[{value:r.countTotal,title:a("Total"),iconClass:"bx:bar-chart"},{value:r.countPublished,title:a("Published"),iconClass:"bx:bar-chart"},{value:r.countUnpublished,title:a("Unpublished"),iconClass:"bx:bar-chart"}];return(u,Z)=>{const w=f("Link"),_=f("Icon");return l(),o("main",D,[d(A),s("div",F,[d(B,{items:y,grid:"3"}),s("div",S,[s("table",E,[s("thead",null,[s("tr",null,[s("th",null,e(n(a)("Title")),1),s("th",null,e(n(a)("Brand Name")),1),s("th",null,e(n(a)("Brand User")),1),s("th",null,e(n(a)("Media Type")),1),s("th",null,e(n(a)("Status")),1),s("th",null,[s("p",M,e(n(a)("Action")),1)])])]),i.posts.total?(l(),o("tbody",O,[(l(!0),o(N,null,U(i.posts.data,(t,x)=>{var h,m,b,p;return l(),o("tr",{key:x},[s("td",null,e(t.title),1),s("td",null,e((h=t.brand)==null?void 0:h.name),1),s("td",null,[t.user?(l(),o("div",R,[s("img",{class:"h-10 rounded-full",src:n(v)((m=t.user)==null?void 0:m.name,(b=t.user)==null?void 0:b.avatar)},null,8,q),s("div",null,[d(w,{href:u.route("admin.users.show",t.user.id),class:"font-bold"},{default:L(()=>{var c;return[P(e((c=t.user)==null?void 0:c.name),1)]}),_:2},1032,["href"]),s("p",null,e((p=t.user)==null?void 0:p.email),1)])])):g("",!0)]),s("td",null,e(t.media_type),1),s("td",null,[s("span",{class:j(["badge",{"badge-primary":t.status=="draft","badge-info":t.status=="publish","badge-danger":t.status=="scheduled","badge-success":t.status=="published"}])},e(t.status),3),s("div",null,[t.is_schedule?(l(),o("span",G,[s("p",null,e(t.scheduled_at),1)])):g("",!0)])]),s("td",null,[s("div",H,[s("div",J,[d(_,{class:"text-2xl",icon:"bx:dots-horizontal-rounded"})]),s("div",K,[s("ul",Q,[s("li",W,[s("button",{onClick:c=>n(k)(u.route("admin.user-logs.brand-posts.destroy",t)),class:"dropdown-link"},[d(_,{icon:"fe:trash"}),s("span",null,e(n(a)("Delete")),1)],8,X)])])])])])])}),128))])):(l(),V(C,{key:1,"for-table":!0}))]),d(T,{links:i.posts.links},null,8,["links"])])])])}}});export{ds as default};
