import{j as s,b5 as o,b4 as c}from"./react-vendor-xYZnmIII.js";import{g as m}from"./ui-components-CQM92IK3.js";import{c as u}from"./date-Burj_6Bf.js";import x from"./assignment-dialog-BSgipPWx.js";import"./inertia-vendor-cBbDTmhJ.js";import"./ui-vendor-Ds9iwIxa.js";import"./interactive-vendor-B1OgcAgP.js";import"./assignment-details-Ll7oM3JY.js";import"./richtor-BECSBxkh.js";import"./assignment-submission-C9b6jq9M.js";import"./assignment-submission-form-BK7JojFL.js";import"./chunked-uploader-input-dQEAsxxf.js";import"./input-error-_LAmvivg.js";import"./loading-button-D7aXR3K4.js";const p=t=>t?new Date>new Date(t):!1,h=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"}},C=[{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=p(e.deadline);return s.jsxs("div",{className:"flex items-center gap-2 py-1",children:[r?s.jsx(o,{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:u(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,d=(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:d?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=h(e);return s.jsx("div",{className:"py-1",children:s.jsx(m,{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{C as AssignmentColumns};
