import{r as p,d0 as c,j as e,aR as x,cO as u,d3 as g,d4 as h,d5 as j,d6 as b}from"./react-vendor-xYZnmIII.js";import{T as f}from"./table-filter-BQQ7Rmfc.js";import{T as C}from"./table-footer-Dfs_f5Wf.js";import{T as R}from"./table-header-CjMHr8CW.js";import{B as T,a as w,aE as N,aF as y,aG as i,aH as d}from"./ui-components-CQM92IK3.js";import{D as M}from"./layout-DC6VQ8xV.js";import S from"./coupon-form-CQFxnPmY.js";import F from"./coupon-table-columns-njMPCSBj.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"./input-error-_LAmvivg.js";import"./loading-button-D7aXR3K4.js";import"./date-Burj_6Bf.js";import"./inertia-FIn3q7f1.js";const E=({coupons:o,exams:r})=>{var l;const[m,n]=p.useState([]),t=c({data:o.data,columns:F({exams:r}),onSortingChange:n,getCoreRowModel:b(),getSortedRowModel:j(),getFilteredRowModel:h(),state:{sorting:m}});return e.jsxs(e.Fragment,{children:[e.jsx(x,{title:"Exam Coupons"}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"Exam Coupons"}),e.jsx("p",{className:"mt-1 text-sm text-gray-600",children:"Manage discount coupons for your exams"})]}),e.jsx(S,{title:"Create Coupon",exams:r,handler:e.jsxs(T,{children:[e.jsx(u,{className:"mr-2 h-4 w-4"}),"Add Coupon"]})})]}),e.jsxs(w,{children:[e.jsx(f,{data:o,title:"Coupon List",globalSearch:!0,tablePageSizes:[10,15,20,25],routeName:"exam-coupons.index"}),e.jsxs(N,{className:"border-border border-y",children:[e.jsx(R,{table:t}),e.jsx(y,{children:(l=t.getRowModel().rows)!=null&&l.length?t.getRowModel().rows.map(s=>e.jsx(i,{"data-state":s.getIsSelected()&&"selected",children:s.getVisibleCells().map(a=>e.jsx(d,{children:g(a.column.columnDef.cell,a.getContext())},a.id))},s.id)):e.jsx(i,{children:e.jsx(d,{colSpan:t.getAllColumns().length,className:"h-24 text-center",children:"No coupons found."})})})]}),e.jsx(C,{className:"p-5 sm:p-7",routeName:"exam-coupons.index",paginationInfo:o})]})]})]})};E.layout=o=>e.jsx(M,{children:o});export{E as default};
