import{r as u,d0 as b,j as e,d3 as g,d4 as h,d5 as j,d6 as f}from"./react-vendor-xYZnmIII.js";import{T}from"./table-filter-BQQ7Rmfc.js";import{T as R}from"./table-footer-Dfs_f5Wf.js";import{T as w}from"./table-header-CjMHr8CW.js";import{B as C,j as E,a as S,aE as M,aF as y,aG as m,aH as n}from"./ui-components-CQM92IK3.js";import{u as N}from"./use-auth-l-ShkEGs.js";import{D as F}from"./layout-DC6VQ8xV.js";import A from"./admin-table-columns-bH3Y8U35.js";import B from"./enrollment-modal-9FXJ6vBQ.js";import D from"./instructor-table-columns-Bk1aa7yy.js";import"./inertia-vendor-cBbDTmhJ.js";import"./ui-vendor-Ds9iwIxa.js";import"./use-lang-Dg6I_Fym.js";import"./debounce-CWHP_ANh.js";import"./route-D0xh7FtZ.js";import"./table-page-size-CzF8rJAG.js";import"./interactive-vendor-B1OgcAgP.js";import"./main-CnGu8e_N.js";import"./theme-colors-CLpwvDr4.js";import"./appearance-5ivIjthu.js";import"./language-C7bQIqs2.js";import"./notification-C3MPMjX2.js";import"./app-logo-BQGZ7CFC.js";import"./delete-modal-h3jQBOO6.js";import"./combobox-BOClc6J1.js";import"./input-error-_LAmvivg.js";import"./loading-button-D7aXR3K4.js";const I=o=>{const{isAdmin:d}=N(),[i,p]=u.useState([]),{translate:a,enrollments:t}=o,{button:x,dashboard:c}=a,l=b({data:t.data,columns:d?A("exam",a,"exam-enrollments.destroy"):D("exam",a),onSortingChange:p,getCoreRowModel:f(),getSortedRowModel:j(),getFilteredRowModel:h(),state:{sorting:i}});return e.jsxs("div",{children:[e.jsx(B,{type:"exam",title:"Add New Exam Enrollment",handler:e.jsx(C,{children:x.add_new_enrollment})}),e.jsx(E,{className:"my-6"}),e.jsxs(S,{children:[e.jsx(T,{data:t,title:"Exam Enrollments",globalSearch:!0,tablePageSizes:[10,15,20,25],routeName:"exam-enrollments.index"}),e.jsxs(M,{className:"border-border border-y",children:[e.jsx(w,{table:l}),e.jsx(y,{children:t.data&&t.data.length>0?l.getRowModel().rows.map(r=>e.jsx(m,{"data-state":r.getIsSelected()&&"selected",children:r.getVisibleCells().map(s=>e.jsx(n,{children:g(s.column.columnDef.cell,s.getContext())},s.id))},r.id)):e.jsx(m,{children:e.jsx(n,{className:"h-24 text-center",children:c.no_results})})})]}),e.jsx(R,{className:"p-5 sm:p-7",routeName:"exam-enrollments.index",paginationInfo:t})]})]})};I.layout=o=>e.jsx(F,{children:o});export{I as default};
