import{r as n,j as s,ca as c}from"./vendor-BKmmeuxg.js";import{B as d}from"./button-BpNwv2aE.js";import{D as p,a as h,b as x,c as u}from"./dialog-B2gN9MvT.js";import{c as j,T as g,a as t,b as l}from"./tabs-Ifouhv9A.js";import b from"./assignment-details-DjTsLMXu.js";import f from"./assignment-submission-CLSFlMAW.js";import"./index-WW_1X1qx.js";import"./utils-DxSsnXxD.js";import"./richtor-CRcM6Du2.js";import"./badge-AQfLLMpR.js";import"./assignment-submission-form-Cp0WFuyh.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 q=({assignment:a})=>{const[o,i]=n.useState(!1),m=a.submissions&&a.submissions.length>0,e=(r=>r?new Date>new Date(r):!1)(a.deadline);return s.jsxs(p,{open:o,onOpenChange:i,children:[s.jsx(h,{asChild:!0,children:s.jsx(d,{variant:"ghost",size:"sm",className:"h-8 gap-2",children:m?s.jsxs(s.Fragment,{children:[s.jsx(c,{className:"h-4 w-4"}),s.jsx("span",{children:"Check"})]}):s.jsx("span",{children:"Submit"})})}),s.jsx(x,{className:"max-h-[90vh] max-w-4xl p-0",children:s.jsxs(j,{defaultValue:"details",className:"w-full",children:[s.jsx(u,{className:"p-6 pb-0",children:s.jsxs(g,{className:"grid h-11 w-full grid-cols-2",children:[s.jsx(t,{value:"details",className:"h-9",children:"Assignment Details"}),s.jsx(t,{value:e?"":"submit",className:"h-9",disabled:e,children:"Assignment Submission"})]})}),s.jsxs("div",{className:"max-h-[calc(90vh-92px)] overflow-y-auto p-6",children:[s.jsx(l,{value:"details",className:"m-0",children:s.jsx(b,{assignment:a,deadlinePassed:e})}),!e&&s.jsx(l,{value:"submit",className:"m-0",children:s.jsx(f,{assignment:a,setDialogOpen:i})})]})]})})]})};export{q as default};
