import{j as e,bd as o}from"./react-vendor-xYZnmIII.js";import{g as m}from"./ui-components-CQM92IK3.js";import h from"./grade-submission-dialog-DoFHoRn3.js";import"./inertia-vendor-cBbDTmhJ.js";import"./ui-vendor-Ds9iwIxa.js";import"./interactive-vendor-B1OgcAgP.js";import"./date-Burj_6Bf.js";import"./assignment-grade-form-CIWwEVFF.js";import"./input-error-_LAmvivg.js";import"./loading-button-D7aXR3K4.js";const L=x=>{const{table:u}=x;return[{accessorKey:"student",header:"Student Name",cell:({row:s})=>{const t=s.original.student;return e.jsxs("div",{className:"py-1",children:[e.jsx("p",{className:"font-medium",children:(t==null?void 0:t.name)||"N/A"}),e.jsx("p",{className:"text-muted-foreground text-xs",children:(t==null?void 0:t.email)||""})]})}},{accessorKey:"is_late",header:()=>e.jsx("div",{className:"text-center",children:"Submission"}),cell:({row:s})=>{const t=s.getValue("is_late");return e.jsx("div",{className:"py-1 text-center",children:e.jsx(m,{variant:t?"destructive":"default",children:t?"Late Submission":"On Time"})})}},{accessorKey:"submitted_at",header:"Submitted At",cell:({row:s})=>{const t=s.getValue("submitted_at");return e.jsxs("div",{className:"py-1 text-sm",children:[e.jsx("p",{children:o(new Date(t),"MMM dd, yyyy")}),e.jsx("p",{className:"text-muted-foreground text-xs",children:o(new Date(t),"hh:mm a")})]})}},{accessorKey:"status",header:()=>e.jsx("div",{className:"text-center",children:"Status"}),cell:({row:s})=>{const t=s.getValue("status"),a=s.original.is_late,i=()=>t==="graded"?"default":a?"destructive":"secondary",r=()=>t==="graded"?"Graded":a?"Late":"Pending";return e.jsx("div",{className:"py-1 text-center",children:e.jsx(m,{variant:i(),children:r()})})}},{accessorKey:"marks_obtained",header:()=>e.jsx("div",{className:"text-center",children:"Marks"}),cell:({row:s})=>{var d,c,l;const t=s.getValue("marks_obtained"),a=s.original,i=a.status==="graded",r=a.is_late,n=r?((d=a.assignment)==null?void 0:d.late_total_mark)||0:((c=a.assignment)==null?void 0:c.total_mark)||0;return e.jsx("div",{className:"py-1 text-center",children:i?e.jsxs("div",{children:[e.jsxs("p",{className:"font-semibold",children:[t," / ",n]}),r&&e.jsxs("p",{className:"text-muted-foreground text-xs",children:["(Late: Max ",(l=a.assignment)==null?void 0:l.late_total_mark,")"]})]}):e.jsxs("div",{children:[e.jsx("p",{className:"text-muted-foreground text-sm",children:"Not Graded"}),e.jsxs("p",{className:"text-muted-foreground text-xs",children:["Max: ",n]})]})})}},{id:"actions",header:()=>e.jsx("div",{className:"text-end",children:u.action}),cell:({row:s})=>{const t=s.original;return e.jsx("div",{className:"flex justify-end gap-2 py-1",children:e.jsx(h,{submission:t})})}}]};export{L as default};
