import{j as s,k as d,i as c,p as m}from"./vendor-rThclpOQ.js";import{B as u}from"./badge-DJgeeB6N.js";import x from"./assignment-dialog-LJ1y5zGd.js";import"./index-DquVdLUg.js";import"./utils-8KAaAB9H.js";import"./button-ZcsoqUQn.js";import"./dialog-CDEDwQhm.js";import"./tabs-NZTgQ56C.js";import"./assignment-details-BKQRUmNU.js";import"./richtor-BYY1_E6w.js";import"./assignment-submission-DoPfjJBy.js";import"./assignment-submission-form-BYBxxVxd.js";import"./chunked-uploader-input-rUbaF7V3.js";import"./input-BeqyurrI.js";import"./index-CWNIUFqh.js";import"./input-error-Br4ngfdE.js";import"./loading-button-DKhpmf6V.js";import"./label-CtY1vfZY.js";import"./select-u0okJC03.js";import"./textarea-DM_GyfeP.js";const p=t=>{if(!t)return"N/A";const e=new Date(t);return m(e,"MMMM dd, yyyy, hh:mm a")},h=t=>t?new Date>new Date(t):!1,g=t=>{if(!t.submissions||t.submissions.length===0)return{status:"not_submitted",label:"Not Submitted",variant:"secondary"};const e=t.submissions[0];return e.status==="graded"?{status:"graded",label:"Graded",variant:"default"}:e.is_late?{status:"late",label:"Late Submission",variant:"destructive"}:{status:"submitted",label:"Submitted",variant:"default"}},E=[{accessorKey:"title",header:"Title",cell:({row:t})=>{const e=t.original;return s.jsxs("div",{className:"space-y-1 py-1",children:[s.jsx("p",{className:"font-medium",children:e.title}),s.jsxs("div",{className:"text-muted-foreground flex items-center gap-4 text-sm",children:[s.jsxs("span",{children:["Total Marks: ",e.total_mark]}),s.jsxs("span",{children:["Pass Marks: ",e.pass_mark]})]})]})}},{accessorKey:"deadline",header:"Deadline",cell:({row:t})=>{const e=t.original,r=h(e.deadline);return s.jsxs("div",{className:"flex items-center gap-2 py-1",children:[r?s.jsx(d,{className:"text-destructive h-4 w-4"}):s.jsx(c,{className:"text-muted-foreground h-4 w-4"}),s.jsx("span",{className:r?"text-destructive":"",children:p(e.deadline)})]})}},{accessorKey:"marks_obtained",header:()=>s.jsx("div",{className:"text-center",children:"Obtained Marks"}),cell:({row:t})=>{var l;const e=t.original,a=e.submissions&&e.submissions.length>0?e.submissions[0]:null,o=(a==null?void 0:a.status)==="graded",i=a==null?void 0:a.is_late,n=i?e.late_total_mark||0:e.total_mark||0;return s.jsx("div",{className:"py-1 text-center",children:o?s.jsxs("div",{children:[s.jsxs("p",{className:"font-semibold",children:[a==null?void 0:a.marks_obtained," / ",n]}),i&&s.jsxs("p",{className:"text-muted-foreground text-xs",children:["(Late: Max ",(l=a==null?void 0:a.assignment)==null?void 0:l.late_total_mark,")"]})]}):s.jsxs("div",{children:[s.jsx("p",{className:"text-muted-foreground text-sm",children:"Not Graded"}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:["Max: ",n]})]})})}},{accessorKey:"status",header:"Status",cell:({row:t})=>{const e=t.original,r=g(e);return s.jsx("div",{className:"py-1",children:s.jsx(u,{variant:r.variant,children:r.label})})}},{id:"actions",header:()=>s.jsx("div",{className:"text-right",children:"Action"}),cell:({row:t})=>{const e=t.original;return s.jsx("div",{className:"flex justify-end py-1",children:s.jsx(x,{assignment:e})})}}];export{E as AssignmentColumns};
