import{jsxs as s,jsx as e}from"react/jsx-runtime";import{D as m}from"./delete-modal-DdJyKUdO.js";import{B as o}from"./ui-components-B24mpb8o.js";import{Link as p,router as d}from"@inertiajs/react";import{ArrowUpDown as c,Eye as g,Pencil as h,Trash2 as u}from"lucide-react";import"react";import"next-themes";import"sonner";import"@radix-ui/react-label";import"class-variance-authority";import"@radix-ui/react-checkbox";import"@radix-ui/react-avatar";import"@radix-ui/react-dropdown-menu";import"@radix-ui/react-scroll-area";import"@radix-ui/react-popover";import"@radix-ui/react-radio-group";import"@radix-ui/react-dialog";import"@radix-ui/react-slot";import"clsx";import"@radix-ui/react-separator";import"@radix-ui/react-tooltip";import"@radix-ui/react-tabs";import"@radix-ui/react-accordion";import"@radix-ui/react-progress";import"@radix-ui/react-select";import"cmdk";import"@radix-ui/react-switch";import"react-day-picker";import"@radix-ui/react-slider";import"embla-carousel-react";import"@radix-ui/react-toggle-group";import"vaul";import"tailwind-merge";const W=n=>{const{table:i}=n;return[{accessorKey:"creator",header:({column:t})=>e("div",{className:"flex items-center pl-4",children:s(o,{variant:"ghost",className:"p-0 hover:bg-transparent",onClick:()=>t.toggleSorting(t.getIsSorted()==="asc"),children:[i.creator,e(c,{})]})}),cell:({row:t})=>s("div",{className:"pl-4",children:[e("p",{className:"mb-0.5 text-base font-medium",children:t.original.user.name}),e("p",{className:"text-muted-foreground text-xs",children:t.original.user.email})]}),sortingFn:(t,r)=>t.original.user.name.localeCompare(r.original.user.name)},{accessorKey:"title",header:i.title,cell:({row:t})=>e("div",{className:"py-1 capitalize",children:e(p,{href:route("blogs.edit",{blog:t.original.id}),children:t.getValue("title")})})},{accessorKey:"category",header:()=>e("div",{className:"flex items-center justify-center",children:e("p",{children:i.category})}),cell:({row:t})=>{var r,a;return e("div",{className:"py-1 text-center capitalize",children:e("p",{children:(a=(r=t.original.category)==null?void 0:r.name)!=null?a:"--"})})},sortingFn:(t,r)=>{var a,l;return(((a=t.original.category)==null?void 0:a.name)||"").localeCompare(((l=r.original.category)==null?void 0:l.name)||"")}},{accessorKey:"status",header:({column:t})=>e("div",{className:"flex items-center justify-center",children:s(o,{variant:"ghost",onClick:()=>t.toggleSorting(t.getIsSorted()==="asc"),children:[i.status,e(c,{})]})}),cell:({row:t})=>e("div",{className:"py-1 text-center capitalize",children:t.getValue("status")})},{id:"actions",header:()=>e("div",{className:"pr-4 text-end",children:i.action}),cell:({row:t})=>{const r=t.original;return s("div",{className:"flex justify-end gap-2 py-1 pr-4",children:[e(o,{asChild:!0,size:"icon",variant:"secondary",className:"h-8 w-8",children:e("a",{target:"_blank",href:route("blogs.preview",r.id),children:e(g,{})})}),e(o,{size:"icon",variant:"secondary",className:"h-8 w-8",onClick:()=>d.get(route("blogs.edit",r.id)),children:e(h,{})}),e(m,{routePath:route("blogs.destroy",r.id),actionComponent:e(o,{size:"icon",variant:"ghost",className:"bg-destructive/8 hover:bg-destructive/6 h-8 w-8 p-0",children:e(u,{className:"text-destructive text-sm"})})})]})}}]};export{W as default};
