import{jsx as e,jsxs as c}from"react/jsx-runtime";import{B as o,c as d}from"./ui-components-B24mpb8o.js";import{router as u}from"@inertiajs/react";import{ArrowUpDown as g}from"lucide-react";import"next-themes";import"sonner";import"react";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 Q=(i,p,m)=>{const{table:r,common:n}=m;return[{accessorKey:"name",header:()=>e("p",{className:"px-3",children:r.name}),cell:({row:t})=>e("div",{className:"px-3 py-1 text-sm font-medium",children:t.getValue("name")})},{accessorKey:"type",header:({column:t})=>e("div",{className:"px-3",children:c(o,{variant:"ghost",onClick:()=>t.toggleSorting(t.getIsSorted()==="asc"),children:[r.type,e(g,{className:"ml-2 h-4 w-4"})]})}),cell:({row:t})=>e("div",{className:"text-muted-foreground px-3 py-1 text-sm capitalize",children:t.getValue("type")})},{accessorKey:"use_case",header:()=>e("p",{className:"px-3",children:r.use_case}),cell:({row:t})=>e("div",{className:"text-muted-foreground px-3 py-1 text-sm",children:t.original.type==="administrative"?r.best_single_instructor:r.best_multiple_instructors})},{accessorKey:"title",header:()=>e("p",{className:"px-3",children:r.title}),cell:({row:t})=>e("div",{className:"text-muted-foreground px-3 py-1 text-sm",children:t.getValue("title")})},{accessorKey:"sections",header:()=>e("p",{className:"px-3",children:r.sections}),cell:({row:t})=>{var s;return e("div",{className:"text-muted-foreground px-3 py-1 text-sm",children:((s=t.original.sections)==null?void 0:s.length)||0})}},{id:"action",header:()=>e("div",{className:"px-3 text-end",children:r.action}),cell:({row:t})=>{var l;const s=t.original,a=s.slug===((l=i==null?void 0:i.fields)==null?void 0:l.page_slug);return c("div",{className:"flex items-center justify-end space-x-3 px-3 py-1",children:[e(o,{asChild:!0,size:"sm",variant:"ghost",className:"border-border border",children:e("a",{target:"_blank",href:route("home.demo",{slug:s.slug}),children:n.preview})}),p.sub_type===s.type&&e(o,{size:"sm",disabled:a,variant:a?"outline":"secondary",className:d("rounded-sm",a?"border-secondary-foreground text-secondary-foreground":""),onClick:()=>a?"":u.post(route("settings.home-page.update",i==null?void 0:i.id),{page_id:s.id,page_name:s.name,page_slug:s.slug}),children:a?r.selected:r.select})]})}}]};export{Q as default};
