import{jsx as e,jsxs as s}from"react/jsx-runtime";import{g as m,U as x,V as f,B as g,W as N,X as o}from"./ui-components-B24mpb8o.js";import{Link as w}from"@inertiajs/react";import{format as a}from"date-fns";import{CheckCircle as y,AlertCircle as v,Clock as b,MoreVertical as D,Eye as M,Pencil as k}from"lucide-react";import A from"./assignment-form-BQw3NQxh.js";import"next-themes";import"sonner";import"react";import"@radix-ui/react-label";import"class-variance-authority";import"@radix-ui/react-checkbox";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"./datetime-picker-CJJWviSb.js";import"./use-lang-Cw_jKJYs.js";import"./input-error-BbsDx4-P.js";import"./loading-button-B_LaGOAp.js";import"./date-BZvGgr5q.js";import"./inertia-FIn3q7f1.js";import"richtor";/* empty css                */const xe=(c,d,p)=>{const{table:h}=d;return[{accessorKey:"title",header:"Assignment Details",cell:({row:r})=>{const t=r.original;return s("div",{className:"space-y-1 py-2",children:[e("p",{className:"text-base font-semibold",children:t.title}),s("div",{className:"text-muted-foreground flex flex-wrap items-center gap-3 text-xs",children:[s("span",{className:"flex items-center gap-1",children:[e(y,{className:"h-3 w-3"}),"Total: ",t.total_mark]}),s("span",{className:"flex items-center gap-1",children:["Pass: ",t.pass_mark]}),s("span",{className:"flex items-center gap-1",children:["Retakes: ",t.retake]})]})]})}},{accessorKey:"deadline",header:"Deadline",cell:({row:r})=>{const t=r.getValue("deadline"),i=new Date>new Date(t);return s("div",{className:"py-2",children:[s("div",{className:"flex items-center gap-2",children:[i?e(v,{className:"text-destructive h-4 w-4 flex-shrink-0"}):e(b,{className:"text-primary h-4 w-4 flex-shrink-0"}),s("div",{children:[e("p",{className:`text-sm font-medium ${i?"text-destructive":""}`,children:a(new Date(t),"MMM dd, yyyy")}),e("p",{className:"text-muted-foreground text-xs",children:a(new Date(t),"hh:mm a")})]})]}),i&&e(m,{variant:"destructive",className:"mt-1 text-xs",children:"Expired"})]})}},{accessorKey:"late_submission",header:()=>e("div",{className:"text-center",children:"Late Submission"}),cell:({row:r})=>{const t=r.original,i=t.late_submission;return s("div",{className:"py-2 text-center",children:[e(m,{variant:i?"default":"secondary",children:i?"Allowed":"Not Allowed"}),i&&t.late_deadline&&s("div",{className:"text-muted-foreground mt-1 text-xs",children:["Until: ",a(new Date(t.late_deadline),"MMM dd")]})]})}},{accessorKey:"submissions",header:()=>e("div",{className:"text-center",children:"Submissions"}),cell:({row:r})=>{var n,l;const t=r.original,i=((n=t.submissions)==null?void 0:n.length)||0;return(l=t.submissions)!=null&&l.filter(u=>u.status==="graded").length,s("div",{className:"py-2 text-center",children:[e("span",{className:"font-semibold",children:i})," of ",e("span",{className:"font-semibold",children:p})]})}},{id:"actions",header:()=>e("div",{className:"text-end",children:h.action}),cell:({row:r})=>{const t=r.original;return e("div",{className:"flex justify-end py-2",children:s(x,{children:[e(f,{asChild:!0,children:s(g,{variant:"secondary",size:"sm",className:"h-8 w-8 p-0",children:[e("span",{className:"sr-only",children:"Open menu"}),e(D,{className:"h-4 w-4"})]})}),s(N,{align:"end",className:"space-y-1",children:[e(o,{asChild:!0,children:s(w,{href:route("courses.edit",{course:t.course_id,tab:c,assignment:t.id}),className:"flex w-full cursor-pointer items-center gap-2",children:[e(M,{className:"h-4 w-4"}),e("span",{children:"View Submissions"})]})}),e(A,{title:"Update Assignment",assignment:t,handler:s(o,{onSelect:i=>i.preventDefault(),className:"flex w-full cursor-pointer items-center gap-2",children:[e(k,{className:"h-4 w-4"}),e("span",{children:"Update Assignment"})]})})]})]})})}}]};export{xe as default};
