import{j as e,d4 as h,k as u,i as j,p as i,y as f,L as g,c3 as N,cX as w}from"./vendor-rThclpOQ.js";import{B as l}from"./badge-DJgeeB6N.js";import{B as y}from"./button-ZcsoqUQn.js";import{D as v,a as b,b as D,c}from"./dropdown-menu-Cm0H42C1.js";import k from"./assignment-form-Bq9J2JLc.js";import"./index-DquVdLUg.js";import"./utils-8KAaAB9H.js";import"./datetime-picker-B9LPFQVw.js";import"./popover-otAaS-4X.js";import"./select-u0okJC03.js";import"./use-lang-BK6P2WMc.js";import"./input-error-Br4ngfdE.js";import"./loading-button-DKhpmf6V.js";import"./checkbox-9ljr9HlI.js";import"./dialog-CDEDwQhm.js";import"./input-BeqyurrI.js";import"./label-CtY1vfZY.js";import"./scroll-area-BCwyUKIK.js";import"./inertia-SZXqLvQm.js";import"./richtor-BYY1_E6w.js";const q=(d,m,o)=>{const{table:x}=m;return[{accessorKey:"title",header:"Assignment Details",cell:({row:a})=>{const s=a.original;return e.jsxs("div",{className:"space-y-1 py-2",children:[e.jsx("p",{className:"text-base font-semibold",children:s.title}),e.jsxs("div",{className:"text-muted-foreground flex flex-wrap items-center gap-3 text-xs",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(h,{className:"h-3 w-3"}),"Total: ",s.total_mark]}),e.jsxs("span",{className:"flex items-center gap-1",children:["Pass: ",s.pass_mark]}),e.jsxs("span",{className:"flex items-center gap-1",children:["Retakes: ",s.retake]})]})]})}},{accessorKey:"deadline",header:"Deadline",cell:({row:a})=>{const s=a.getValue("deadline"),t=new Date>new Date(s);return e.jsxs("div",{className:"py-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[t?e.jsx(u,{className:"text-destructive h-4 w-4 flex-shrink-0"}):e.jsx(j,{className:"text-primary h-4 w-4 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:`text-sm font-medium ${t?"text-destructive":""}`,children:i(new Date(s),"MMM dd, yyyy")}),e.jsx("p",{className:"text-muted-foreground text-xs",children:i(new Date(s),"hh:mm a")})]})]}),t&&e.jsx(l,{variant:"destructive",className:"mt-1 text-xs",children:"Expired"})]})}},{accessorKey:"late_submission",header:()=>e.jsx("div",{className:"text-center",children:"Late Submission"}),cell:({row:a})=>{const s=a.original,t=s.late_submission;return e.jsxs("div",{className:"py-2 text-center",children:[e.jsx(l,{variant:t?"default":"secondary",children:t?"Allowed":"Not Allowed"}),t&&s.late_deadline&&e.jsxs("div",{className:"text-muted-foreground mt-1 text-xs",children:["Until: ",i(new Date(s.late_deadline),"MMM dd")]})]})}},{accessorKey:"submissions",header:()=>e.jsx("div",{className:"text-center",children:"Submissions"}),cell:({row:a})=>{var n,r;const s=a.original,t=((n=s.submissions)==null?void 0:n.length)||0;return(r=s.submissions)!=null&&r.filter(p=>p.status==="graded").length,e.jsxs("div",{className:"py-2 text-center",children:[e.jsx("span",{className:"font-semibold",children:t})," of ",e.jsx("span",{className:"font-semibold",children:o})]})}},{id:"actions",header:()=>e.jsx("div",{className:"text-end",children:x.action}),cell:({row:a})=>{const s=a.original;return e.jsx("div",{className:"flex justify-end py-2",children:e.jsxs(v,{children:[e.jsx(b,{asChild:!0,children:e.jsxs(y,{variant:"secondary",size:"sm",className:"h-8 w-8 p-0",children:[e.jsx("span",{className:"sr-only",children:"Open menu"}),e.jsx(f,{className:"h-4 w-4"})]})}),e.jsxs(D,{align:"end",className:"space-y-1",children:[e.jsx(c,{asChild:!0,children:e.jsxs(g,{href:route("courses.edit",{course:s.course_id,tab:d,assignment:s.id}),className:"flex w-full cursor-pointer items-center gap-2",children:[e.jsx(N,{className:"h-4 w-4"}),e.jsx("span",{children:"View Submissions"})]})}),e.jsx(k,{title:"Update Assignment",assignment:s,handler:e.jsxs(c,{onSelect:t=>t.preventDefault(),className:"flex w-full cursor-pointer items-center gap-2",children:[e.jsx(w,{className:"h-4 w-4"}),e.jsx("span",{children:"Update Assignment"})]})})]})]})})}}]};export{q as default};
