import{jsxs as n,jsx as o}from"react/jsx-runtime";import{T as u}from"./table-header-DXTJ1r7-.js";import{aD as h,aE as f,aF as d,c as R,aG as c}from"./ui-components-B24mpb8o.js";import{usePage as T}from"@inertiajs/react";import{useReactTable as M,getFilteredRowModel as N,getSortedRowModel as w,getCoreRowModel as C,flexRender as S}from"@tanstack/react-table";import*as x from"react";import y from"./instructors-table-columns-B3zUZDCZ.js";import F from"./table-filter-C7i2xfqe.js";import j from"./table-footer-MZFbWHJN.js";import"next-themes";import"sonner";import"@radix-ui/react-label";import"class-variance-authority";import"@radix-ui/react-checkbox";import"lucide-react";import"@radix-ui/react-avatar";import"@radix-ui/react-dropdown-menu";import"@radix-ui/react-scroll-area";import"@radix-ui/react-popover";import"@radix-ui/react-radio-group";import"@radix-ui/react-dialog";import"@radix-ui/react-slot";import"clsx";import"@radix-ui/react-separator";import"@radix-ui/react-tooltip";import"@radix-ui/react-tabs";import"@radix-ui/react-accordion";import"@radix-ui/react-progress";import"@radix-ui/react-select";import"cmdk";import"@radix-ui/react-switch";import"react-day-picker";import"@radix-ui/react-slider";import"embla-carousel-react";import"@radix-ui/react-toggle-group";import"vaul";import"tailwind-merge";import"./table-page-size-B94DPeOD.js";import"./route-D0xh7FtZ.js";import"./debounce-CWHP_ANh.js";const uo=({instructors:r,selectedIds:e=[],onCourseSelect:a})=>{var s;const p=T(),l=p.props.type==="demo"?"home.demo":"home",[g,b]=x.useState([]),i=M({data:r.data,columns:y(p.props.translate),onSortingChange:b,getCoreRowModel:C(),getSortedRowModel:w(),getFilteredRowModel:N(),state:{sorting:g}});return n("div",{children:[o(F,{data:r,title:"Instructors",globalSearch:!0,searchKey:"instructor",tablePageSizes:[10,15,20,25],routeName:l}),n(h,{className:"border-border border-y",children:[o(u,{table:i}),o(f,{children:(s=i.getRowModel().rows)!=null&&s.length?i.getRowModel().rows.map(t=>o(d,{"data-state":t.getIsSelected()&&"selected",className:R("hover:bg-muted cursor-pointer",(e==null?void 0:e.includes(Number(t.original.id)))&&"bg-secondary-light"),onClick:()=>a&&a(Number(t.original.id)),children:t.getVisibleCells().map(m=>o(c,{children:S(m.column.columnDef.cell,m.getContext())},m.id))},t.id)):o(d,{children:o(c,{className:"h-24 text-center",children:"No results."})})})]}),o(j,{className:"p-4",routeName:l,paginationInfo:r,paginationKey:"instructor"})]})};export{uo as default};
