import{jsx as e,jsxs as o}from"react/jsx-runtime";import{g as d}from"./ui-components-B24mpb8o.js";import"next-themes";import"sonner";import"react";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";const J=(l,n)=>{const{table:i}=n;return[{id:"index",header:()=>e("div",{className:"pl-4",children:"#"}),cell:({row:r})=>e("div",{className:"w-4 pl-4 text-center font-medium",children:r.index+1})},{id:"name",header:i.name,cell:({row:r})=>{const t=r.original.user;return o("div",{className:"flex items-center gap-3",children:[e("div",{className:"bg-muted h-12 w-12 overflow-hidden rounded-full",children:t.photo?e("img",{src:t.photo,alt:t.name,className:"h-full w-full object-cover"}):e("div",{className:"flex h-full w-full items-center justify-center bg-gray-200 text-gray-500",children:e("span",{className:"text-lg",children:i.img_placeholder})})}),o("div",{children:[e("p",{className:"font-medium",children:t.name}),e("p",{className:"text-muted-foreground text-sm",children:t.email})]})]})}},{id:"enrolled_course",header:()=>l==="course"?i.enrolled_course:"Enrolled Exam",cell:({row:r})=>{const t=r.original,a=r.original;return e("div",{className:"max-w-md",children:e("p",{className:"line-clamp-1",children:l==="course"?a.course.title:t.exam.title})})}},{id:"enrolled_date",header:i.enrolled_date,cell:({row:r})=>{const a=new Date(r.original.entry_date).toLocaleDateString("en-US",{month:"long",day:"2-digit",year:"numeric"});return e("div",{children:a})}},{id:"expiry_date",header:()=>e("div",{className:"pr-4 text-end",children:i.expiry_date}),cell:({row:r})=>{if(!r.original.expiry_date)return e("div",{className:"pr-4 text-end",children:e(d,{className:"bg-green-100 text-green-800 hover:bg-green-100",children:i.lifetime_access})});const a=new Date(r.original.expiry_date).toLocaleDateString("en-US",{month:"long",day:"2-digit",year:"numeric"});return e("div",{className:"pr-4 text-end",children:a})}}]};export{J as default};
