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