import{r as d,bV as c,j as e,H as x,bm as u,bY as b,bZ as g,b_ as h,b$ as j}from"./vendor-BKmmeuxg.js";import{T as C}from"./table-filter-D1fnjeZE.js";import{T as f}from"./table-footer-B-sB7gNG.js";import{T}from"./table-header-DVkEnG6Y.js";import{B as R}from"./button-BpNwv2aE.js";import{C as w}from"./card-D9_SJYq6.js";import{T as N,a as y,b as m,c as l}from"./table-DWOXv4Pu.js";import{D as M}from"./layout-DkwBWm5d.js";import S from"./coupon-form-BRNAH87c.js";import F from"./coupon-table-columns-DhZL0KJa.js";import"./use-lang-YfV87_zl.js";import"./debounce-CWHP_ANh.js";import"./route-B4ZMN77y.js";import"./utils-DxSsnXxD.js";import"./dropdown-menu-DO-po5c1.js";import"./scroll-area-C8HGru-R.js";import"./table-page-size-OCfjNXER.js";import"./index-WW_1X1qx.js";import"./sidebar-BYcYxQeZ.js";import"./separator-_3LZ_wAA.js";import"./sheet-DSvHVmaW.js";import"./tooltip-BsX7Z6vz.js";import"./main-_V386djS.js";import"./index-D9-QKOod.js";import"./appearance-D2z3xcjR.js";import"./app-BytVvUs_.js";/* empty css            */import"./language-BFZ7KItL.js";import"./notification-CYMPYbAP.js";import"./popover-B4kBsMuI.js";import"./app-logo-CmnEIwal.js";import"./accordion-CNBvFN43.js";import"./avatar-j28afJTV.js";import"./input-error-LaPr_4wd.js";import"./loading-button-BnTVAMJ7.js";import"./dialog-B2gN9MvT.js";import"./input-DM0goJrn.js";import"./label-HmIcv5Yx.js";import"./select-CD9o3HN1.js";import"./switch-DFFqeub-.js";import"./inertia-SZXqLvQm.js";import"./badge-AQfLLMpR.js";const v=({coupons:o,courses:a})=>{var i;const[p,n]=d.useState([]),t=c({data:o.data,columns:F({courses:a}),onSortingChange:n,getCoreRowModel:j(),getSortedRowModel:h(),getFilteredRowModel:g(),state:{sorting:p}});return e.jsxs(e.Fragment,{children:[e.jsx(x,{title:"Course 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:"Course Coupons"}),e.jsx("p",{className:"mt-1 text-sm text-gray-600",children:"Manage discount coupons for your Courses"})]}),e.jsx(S,{title:"Create Coupon",courses:a,handler:e.jsxs(R,{children:[e.jsx(u,{className:"mr-2 h-4 w-4"}),"Add Coupon"]})})]}),e.jsxs(w,{children:[e.jsx(C,{data:o,title:"Coupon List",globalSearch:!0,tablePageSizes:[10,15,20,25],routeName:"Course-coupons.index"}),e.jsxs(N,{className:"border-border border-y",children:[e.jsx(T,{table:t}),e.jsx(y,{children:(i=t.getRowModel().rows)!=null&&i.length?t.getRowModel().rows.map(r=>e.jsx(m,{"data-state":r.getIsSelected()&&"selected",children:r.getVisibleCells().map(s=>e.jsx(l,{children:b(s.column.columnDef.cell,s.getContext())},s.id))},r.id)):e.jsx(m,{children:e.jsx(l,{colSpan:t.getAllColumns().length,className:"h-24 text-center",children:"No coupons found."})})})]}),e.jsx(f,{className:"p-5 sm:p-7",routeName:"Course-coupons.index",paginationInfo:o})]})]})]})};v.layout=o=>e.jsx(M,{children:o});export{v as default};
