import{j as e,cW as c,L as o,c3 as d,e as m,cX as g,T as x}from"./vendor-rThclpOQ.js";import{D as h}from"./delete-modal-CrLtMjfS.js";import{B as r}from"./button-ZcsoqUQn.js";import"./dialog-CDEDwQhm.js";import"./utils-8KAaAB9H.js";import"./index-DquVdLUg.js";const N=n=>{const{table:t}=n;return[{accessorKey:"creator",header:({column:s})=>e.jsx("div",{className:"flex items-center pl-4",children:e.jsxs(r,{variant:"ghost",className:"p-0 hover:bg-transparent",onClick:()=>s.toggleSorting(s.getIsSorted()==="asc"),children:[t.creator,e.jsx(c,{})]})}),cell:({row:s})=>e.jsxs("div",{className:"pl-4",children:[e.jsx("p",{className:"mb-0.5 text-base font-medium",children:s.original.user.name}),e.jsx("p",{className:"text-muted-foreground text-xs",children:s.original.user.email})]}),sortingFn:(s,a)=>s.original.user.name.localeCompare(a.original.user.name)},{accessorKey:"title",header:t.title,cell:({row:s})=>e.jsx("div",{className:"py-1 capitalize",children:e.jsx(o,{href:route("blogs.edit",{blog:s.original.id}),children:s.getValue("title")})})},{accessorKey:"category",header:()=>e.jsx("div",{className:"flex items-center justify-center",children:e.jsx("p",{children:t.category})}),cell:({row:s})=>{var a;return e.jsx("div",{className:"py-1 text-center capitalize",children:e.jsx("p",{children:((a=s.original.category)==null?void 0:a.name)??"--"})})},sortingFn:(s,a)=>{var i,l;return(((i=s.original.category)==null?void 0:i.name)||"").localeCompare(((l=a.original.category)==null?void 0:l.name)||"")}},{accessorKey:"status",header:({column:s})=>e.jsx("div",{className:"flex items-center justify-center",children:e.jsxs(r,{variant:"ghost",onClick:()=>s.toggleSorting(s.getIsSorted()==="asc"),children:[t.status,e.jsx(c,{})]})}),cell:({row:s})=>e.jsx("div",{className:"py-1 text-center capitalize",children:s.getValue("status")})},{id:"actions",header:()=>e.jsx("div",{className:"pr-4 text-end",children:t.action}),cell:({row:s})=>{const a=s.original;return e.jsxs("div",{className:"flex justify-end gap-2 py-1 pr-4",children:[e.jsx(r,{asChild:!0,size:"icon",variant:"secondary",className:"h-8 w-8",children:e.jsx("a",{target:"_blank",href:route("blogs.preview",a.id),children:e.jsx(d,{})})}),e.jsx(r,{size:"icon",variant:"secondary",className:"h-8 w-8",onClick:()=>m.get(route("blogs.edit",a.id)),children:e.jsx(g,{})}),e.jsx(h,{routePath:route("blogs.destroy",a.id),actionComponent:e.jsx(r,{size:"icon",variant:"ghost",className:"bg-destructive/8 hover:bg-destructive/6 h-8 w-8 p-0",children:e.jsx(x,{className:"text-destructive text-sm"})})})]})}}]};export{N as default};
