import{j as s,L as a}from"./app-BI7hSYr0.js";import{A as n}from"./AppLayout-ahz_yU39.js";const c={test:"تستی",descriptive:"تشریحی",mixed:"ترکیبی"},d={started:{label:"در حال انجام",cls:"badge badge-warning"},submitted:{label:"ارسال شد",cls:"badge badge-success"},graded:{label:"نمره‌گذاری شد",cls:"badge badge-success"},expired:{label:"منقضی",cls:"badge badge-secondary"}};function b({exams:l}){return s.jsx(n,{title:"امتحانات",children:s.jsxs("div",{className:"page-stack",children:[s.jsx("section",{className:"section-header",children:s.jsxs("div",{children:[s.jsxs("h2",{children:[s.jsx("i",{className:"bi bi-pencil-square",style:{marginLeft:"0.5rem",color:"var(--color-primary)"}}),"امتحانات"]}),s.jsx("p",{children:"امتحانات منتشرشده برای کلاس‌های شما"})]})}),l.length===0?s.jsx("section",{className:"panel-card",children:s.jsxs("div",{style:{textAlign:"center",padding:"2rem 1rem"},children:[s.jsx("div",{className:"icon-badge",style:{width:56,height:56,fontSize:"1.5rem",margin:"0 auto 1rem"},children:s.jsx("i",{className:"bi bi-pencil-square"})}),s.jsx("h2",{children:"امتحانی وجود ندارد"}),s.jsx("p",{children:"در حال حاضر امتحان فعالی برای کلاس‌های شما ثبت نشده است."})]})}):s.jsx("div",{className:"card-grid",children:l.map(e=>{const i=e.sessionId&&e.sessionStatus!=="started",r=e.sessionStatus==="started",t=e.sessionStatus?d[e.sessionStatus]:null;return s.jsxs("article",{className:"panel-card",style:{display:"flex",flexDirection:"column",gap:"0.75rem",borderColor:i?"var(--color-primary-soft)":r?"#f59e0b":void 0,background:i?"var(--color-primary-soft)":r?"#fef3c710":void 0},children:[s.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"0.75rem"},children:[s.jsx("span",{className:"icon-badge",style:{flexShrink:0},children:s.jsx("i",{className:"bi bi-pencil-square"})}),s.jsxs("div",{style:{flex:1},children:[s.jsx("h3",{style:{margin:0,fontSize:"1rem"},children:e.title}),s.jsxs("div",{style:{display:"flex",gap:"0.5rem",flexWrap:"wrap",marginTop:"0.25rem"},children:[s.jsxs("span",{style:{fontSize:"0.8rem",color:"var(--color-text-muted)"},children:[s.jsx("i",{className:"bi bi-door-open",style:{marginLeft:"0.25rem"}}),e.classroom]}),e.subject!=="—"&&s.jsxs("span",{style:{fontSize:"0.8rem",color:"var(--color-text-muted)"},children:[s.jsx("i",{className:"bi bi-book",style:{marginLeft:"0.25rem"}}),e.subject]}),s.jsx("span",{style:{fontSize:"0.8rem",color:"var(--color-text-muted)"},children:c[e.type]??e.type})]})]}),t&&s.jsx("span",{className:t.cls,style:{flexShrink:0},children:t.label})]}),s.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"1rem",fontSize:"0.82rem",color:"var(--color-text-muted)"},children:[e.startsAt!=="—"&&s.jsxs("span",{children:[s.jsx("i",{className:"bi bi-calendar-event",style:{marginLeft:"0.3rem"}}),"از ",e.startsAt]}),e.endsAt!=="—"&&s.jsxs("span",{children:[s.jsx("i",{className:"bi bi-calendar-x",style:{marginLeft:"0.3rem"}}),"تا ",e.endsAt]}),e.durationMinutes&&s.jsxs("span",{children:[s.jsx("i",{className:"bi bi-stopwatch",style:{marginLeft:"0.3rem"}}),e.durationMinutes," دقیقه"]}),s.jsxs("span",{children:[s.jsx("i",{className:"bi bi-award",style:{marginLeft:"0.3rem"}}),"نمره کل: ",e.maxScore]})]}),i?s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.4rem",background:"white",border:"1px solid var(--color-primary-soft)",borderRadius:"var(--radius-sm)",color:"var(--color-primary-active)",fontSize:"0.875rem",fontWeight:700,padding:"0.6rem 0.9rem"},children:[s.jsx("i",{className:"bi bi-check-circle-fill"}),"امتحان ارسال شد",e.sessionScore!==null&&s.jsxs("span",{style:{marginRight:"auto",fontWeight:700},children:["نمره MCQ: ",e.sessionScore]}),e.submittedAt&&s.jsx("span",{style:{fontWeight:400,color:"var(--color-text-muted)",fontSize:"0.8rem"},children:e.submittedAt})]}):e.isAvailable?s.jsx(a,{href:`/student/exams/${e.id}`,className:`btn ${r?"btn-warning":"btn-primary"}`,style:{textAlign:"center"},children:r?s.jsxs(s.Fragment,{children:[s.jsx("i",{className:"bi bi-play-circle"})," ادامه امتحان"]}):s.jsxs(s.Fragment,{children:[s.jsx("i",{className:"bi bi-pencil"})," شروع امتحان"]})}):s.jsxs("div",{style:{textAlign:"center",padding:"0.6rem",background:"var(--color-bg-muted)",borderRadius:"var(--radius-sm)",color:"var(--color-text-muted)",fontSize:"0.875rem"},children:[s.jsx("i",{className:"bi bi-clock",style:{marginLeft:"0.3rem"}}),"هنوز شروع نشده یا زمان پایان یافته"]})]},e.id)})})]})})}export{b as default};
