import{u as m,j as e,c0 as l,L as u,e as x,c1 as h,T as p}from"./vendor-BKmmeuxg.js";import{D as j}from"./delete-modal-D1GJlb1P.js";import{B as i}from"./button-BpNwv2aE.js";import{u as g}from"./use-auth-NG-DQJrC.js";import{s as y}from"./utils-DxSsnXxD.js";import f from"./course-status-filter-BWukaaQV.js";import"./dialog-B2gN9MvT.js";import"./index-WW_1X1qx.js";import"./dropdown-menu-DO-po5c1.js";import"./route-B4ZMN77y.js";const D=()=>{const{isAdmin:n}=g(),{system:o,translate:d}=m().props,{table:t,common:a}=d,c=y(o.fields.selling_currency);return[{accessorKey:"name",header:({column:s})=>e.jsx("div",{className:"flex items-center pl-4",children:e.jsxs(i,{variant:"ghost",className:"p-0 hover:bg-transparent",onClick:()=>s.toggleSorting(s.getIsSorted()==="asc"),children:[t.name,e.jsx(l,{})]})}),cell:({row:s})=>e.jsxs("div",{className:"pl-4",children:[e.jsx("p",{className:"mb-0.5 text-base font-medium",children:s.original.instructor.user.name}),e.jsx("p",{className:"text-muted-foreground text-xs",children:s.original.instructor.user.email})]})},{accessorKey:"title",header:t.course_title,cell:({row:s})=>e.jsx("div",{className:"py-1 capitalize",children:e.jsx(u,{href:route("courses.edit",{course:s.original.id}),children:s.getValue("title")})})},{accessorKey:"status",header:({column:s})=>e.jsx("div",{className:"flex justify-center",children:e.jsx(f,{})}),cell:({row:s})=>e.jsx("div",{className:"py-1 text-center capitalize",children:s.getValue("status")})},{accessorKey:"category",header:({column:s})=>e.jsx("div",{className:"flex items-center justify-center",children:e.jsx("p",{children:"Category"})}),cell:({row:s})=>e.jsx("div",{className:"py-1 text-center capitalize",children:e.jsx("p",{children:s.original.course_category.title})})},{accessorKey:"category_child",header:({column:s})=>e.jsx("div",{className:"flex items-center justify-center",children:e.jsx("p",{children:t.category_child})}),cell:({row:s})=>{var r;return e.jsx("div",{className:"py-1 text-center capitalize",children:e.jsx("p",{children:((r=s.original.course_category_child)==null?void 0:r.title)||"--"})})}},{accessorKey:"price",header:({column:s})=>e.jsx("div",{className:"flex items-center justify-center",children:e.jsxs(i,{variant:"ghost",onClick:()=>s.toggleSorting(s.getIsSorted()==="asc"),children:[a.price,e.jsx(l,{})]})}),cell:({row:s})=>e.jsx("div",{className:"py-1 text-center capitalize",children:e.jsx("p",{children:s.original.price?`${c==null?void 0:c.symbol}${s.original.price}`:a.free})})},{id:"actions",header:()=>e.jsx("div",{className:"pr-4 text-end",children:t.action}),cell:({row:s})=>{const r=s.original;return e.jsxs("div",{className:"flex justify-end gap-2 py-1 pr-4",children:[e.jsx(i,{size:"icon",variant:"secondary",className:"h-8 w-8",onClick:()=>x.get(route("courses.edit",{course:r.id})),children:e.jsx(h,{})}),n&&e.jsx(j,{routePath:route("courses.destroy",r.id),message:t.delete_course_warning,actionComponent:e.jsx(i,{size:"icon",variant:"ghost",className:"bg-destructive/8 hover:bg-destructive/6 h-8 w-8 p-0",children:e.jsx(p,{className:"text-destructive text-sm"})})})]})}}]};export{D as default};
