import{r as x,cP as b,j as o,cS as g,cT as h,cU as f,cV as j}from"./vendor-rThclpOQ.js";import{T}from"./table-filter-YjsfaEUk.js";import{T as C}from"./table-footer-CXgex4hi.js";import{T as R}from"./table-header-Cuecslh2.js";import{B as S}from"./button-ZcsoqUQn.js";import{C as w}from"./card-HXna_7vU.js";import{S as M}from"./separator-Cir9hccx.js";import{T as y,a as N,b as l,c as n}from"./table-DoQbaWlF.js";import{u as A}from"./use-auth-C-KzOAQ_.js";import{D as E}from"./layout-Dtu8Rjtg.js";import F from"./admin-table-columns-bBn5FmKB.js";import _ from"./enrollment-modal-DwvlWm8t.js";import B from"./instructor-table-columns-CN3d9bAy.js";import"./use-lang-BK6P2WMc.js";import"./debounce-CWHP_ANh.js";import"./route-B4ZMN77y.js";import"./utils-8KAaAB9H.js";import"./dropdown-menu-Cm0H42C1.js";import"./scroll-area-BCwyUKIK.js";import"./table-page-size-FBmivxVb.js";import"./index-DquVdLUg.js";import"./sidebar-Buyv7mEV.js";import"./sheet-BfC102Vr.js";import"./tooltip-WOIaUmuC.js";import"./main-CC75Iw88.js";import"./sonner-CgbrDmPW.js";import"./index-CWNIUFqh.js";import"./appearance-Bwg83W1G.js";import"./app-BsPpMpSR.js";/* empty css            */import"./language-BmlkXzFK.js";import"./notification-Bti7isEF.js";import"./popover-otAaS-4X.js";import"./app-logo-Bj2M2lhk.js";import"./accordion-by19KtHq.js";import"./avatar-BsP_s7dr.js";import"./delete-modal-CrLtMjfS.js";import"./dialog-CDEDwQhm.js";import"./badge-DJgeeB6N.js";import"./combobox-BcY46xTj.js";import"./input-error-Br4ngfdE.js";import"./loading-button-DKhpmf6V.js";import"./label-CtY1vfZY.js";import"./radio-group-ZDy0XuKl.js";const D=e=>{const{isAdmin:d}=A(),[p,c]=x.useState([]),{translate:r,enrollments:t}=e,{button:u,dashboard:m}=r,i=b({data:t.data,columns:d?F("course",r,"enrollments.destroy"):B("course",r),onSortingChange:c,getCoreRowModel:j(),getSortedRowModel:f(),getFilteredRowModel:h(),state:{sorting:p}});return o.jsxs("div",{children:[o.jsx(_,{type:"course",title:"Add New Course Enrollment",handler:o.jsx(S,{children:u.add_new_enrollment})}),o.jsx(M,{className:"my-6"}),o.jsxs(w,{children:[o.jsx(T,{data:t,title:m.course_list,globalSearch:!0,tablePageSizes:[10,15,20,25],routeName:"course-enrollments.index"}),o.jsxs(y,{className:"border-border border-y",children:[o.jsx(R,{table:i}),o.jsx(N,{children:t.data&&t.data.length>0?i.getRowModel().rows.map(s=>o.jsx(l,{"data-state":s.getIsSelected()&&"selected",children:s.getVisibleCells().map(a=>o.jsx(n,{children:g(a.column.columnDef.cell,a.getContext())},a.id))},s.id)):o.jsx(l,{children:o.jsx(n,{className:"h-24 text-center",children:m.no_results})})})]}),o.jsx(C,{className:"p-5 sm:p-7",routeName:"course-enrollments.index",paginationInfo:t})]})]})};D.layout=e=>o.jsx(E,{children:e});export{D as default};
