2 lines
2.8 KiB
JavaScript
2 lines
2.8 KiB
JavaScript
import{j as e,q as o}from"./vendor-BKmmeuxg.js";import{B as m}from"./badge-AQfLLMpR.js";import p from"./grade-submission-dialog-7aCXHjB7.js";import"./index-WW_1X1qx.js";import"./utils-DxSsnXxD.js";import"./button-BpNwv2aE.js";import"./dialog-B2gN9MvT.js";import"./scroll-area-C8HGru-R.js";import"./assignment-grade-form-CfP85CNW.js";import"./input-error-LaPr_4wd.js";import"./loading-button-BnTVAMJ7.js";import"./input-DM0goJrn.js";import"./label-HmIcv5Yx.js";import"./select-CD9o3HN1.js";import"./textarea-CyndvowL.js";const G=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(p,{submission:t})})}}]};export{G as default};
|