import{j as e,ca as l,l as i,k as o,v as x,q as h}from"./vendor-BKmmeuxg.js";import{B as n}from"./badge-AQfLLMpR.js";import{B as p}from"./button-BpNwv2aE.js";import j from"./assignment-submission-form-Cp0WFuyh.js";import"./index-WW_1X1qx.js";import"./utils-DxSsnXxD.js";import"./chunked-uploader-input-D0XPVOTS.js";import"./input-DM0goJrn.js";import"./index-D9-QKOod.js";import"./input-error-LaPr_4wd.js";import"./loading-button-BnTVAMJ7.js";import"./label-HmIcv5Yx.js";import"./select-CD9o3HN1.js";import"./textarea-CyndvowL.js";const G=({assignment:s,setDialogOpen:c})=>{const a=s.submissions&&s.submissions.length>0,r=a?s.submissions[0]:null,t=(r==null?void 0:r.status)==="graded",m=d=>d?h(new Date(d),"MMMM dd, yyyy, hh:mm a"):"N/A";return e.jsx("div",{className:"space-y-6",children:a?e.jsxs("div",{className:"overflow-hidden rounded-lg border",children:[e.jsx("div",{className:"bg-primary/10 border-b p-4",children:e.jsx("h3",{className:"flex items-center gap-2 font-semibold",children:t?e.jsxs(e.Fragment,{children:[e.jsx(l,{className:"h-5 w-5 text-green-600"}),"Graded"]}):r!=null&&r.is_late?e.jsxs(e.Fragment,{children:[e.jsx(i,{className:"text-destructive h-5 w-5"}),"Late Submission"]}):e.jsxs(e.Fragment,{children:[e.jsx(o,{className:"h-5 w-5 text-blue-600"}),"Under Review"]})})}),e.jsxs("div",{className:"space-y-4 p-6",children:[t&&e.jsxs("div",{className:"rounded-lg border border-green-200 bg-green-50 p-4 dark:border-green-800 dark:bg-green-950",children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[e.jsx("span",{className:"font-medium",children:"Marks Obtained"}),e.jsxs("span",{className:"text-2xl font-bold text-green-600",children:[r==null?void 0:r.marks_obtained," / ",s.total_mark]})]}),(r==null?void 0:r.instructor_feedback)&&e.jsxs("div",{className:"mt-4 border-t border-green-200 pt-4 dark:border-green-800",children:[e.jsx("p",{className:"mb-2 text-sm font-medium",children:"Instructor Feedback:"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:r.instructor_feedback})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"Submitted At:"}),e.jsx("span",{className:"font-medium",children:m(r==null?void 0:r.submitted_at)})]}),e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"Attempt Number:"}),e.jsxs(n,{variant:"secondary",children:["Attempt ",r==null?void 0:r.attempt_number]})]}),e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"Status:"}),e.jsx(n,{variant:t?"default":r!=null&&r.is_late?"destructive":"secondary",children:(r==null?void 0:r.status)==="graded"?"Graded":r!=null&&r.is_late?"Late Submission":"Pending"})]})]}),(r==null?void 0:r.comment)&&e.jsxs("div",{className:"border-t pt-4",children:[e.jsx("p",{className:"mb-2 text-sm font-medium",children:"Your Comment:"}),e.jsx("p",{className:"text-muted-foreground bg-muted rounded-lg p-3 text-sm",children:r.comment})]}),(r==null?void 0:r.attachment_path)&&e.jsxs("div",{className:"border-t pt-4",children:[e.jsxs("p",{className:"mb-2 text-sm font-medium",children:["Submitted ",r.attachment_type==="url"?"URL":"File",":"]}),r.attachment_type==="url"?e.jsx("a",{href:r.attachment_path,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:r.attachment_path}):e.jsx(p,{variant:"outline",size:"sm",className:"gap-2",asChild:!0,children:e.jsxs("a",{href:`/storage/${r.attachment_path}`,download:!0,children:[e.jsx(x,{className:"h-4 w-4"}),"Download File"]})})]})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"bg-secondary-lighter rounded-lg p-4",children:[e.jsx("h3",{className:"mb-2 font-semibold",children:"Submission Guidelines"}),e.jsxs("ul",{className:"text-muted-foreground list-inside list-disc space-y-2 text-sm",children:[e.jsx("li",{children:"Follow the instructions carefully."}),e.jsx("li",{children:"Submit your assignment by following one of the two methods"}),e.jsx("li",{className:"ml-6",children:"○ Upload a file (ZIP, PDF, DOC, etc.)"}),e.jsx("li",{className:"ml-6",children:"○ Share a public URL (GitHub, Google Drive, etc.)"}),e.jsx("li",{children:"Add any comments or notes in the comment field below."})]})]}),e.jsx(j,{assignment:s,setDialogOpen:c})]})})};export{G as default};
