import{j as e,L as a}from"./app-BeXbqfQ0.js";import{A as i}from"./AppLayout-DFlN-unB.js";function d({votings:r}){return e.jsx(i,{title:"رأی‌گیری‌های فعال",children:e.jsxs("div",{className:"page-stack",children:[e.jsx("section",{className:"section-header",children:e.jsxs("div",{children:[e.jsxs("h2",{children:[e.jsx("i",{className:"bi bi-ballot",style:{marginLeft:"0.5rem",color:"var(--color-primary)"}}),"رأی‌گیری‌ها"]}),e.jsx("p",{children:"رأی‌گیری‌های فعال که می‌توانید در آن‌ها شرکت کنید."})]})}),r.length===0?e.jsx("section",{className:"panel-card",children:e.jsxs("div",{style:{textAlign:"center",padding:"2rem 1rem"},children:[e.jsx("div",{className:"icon-badge",style:{width:56,height:56,fontSize:"1.5rem",margin:"0 auto 1rem"},children:e.jsx("i",{className:"bi bi-ballot"})}),e.jsx("h2",{children:"رأی‌گیری فعالی وجود ندارد"}),e.jsx("p",{children:"در حال حاضر هیچ رأی‌گیری فعالی برای شرکت وجود ندارد."})]})}):e.jsx("div",{className:"card-grid",children:r.map(s=>e.jsxs("article",{className:"panel-card",style:{display:"flex",flexDirection:"column",gap:"0.75rem",borderColor:s.alreadyVoted?"var(--color-primary-soft)":void 0,background:s.alreadyVoted?"var(--color-primary-soft)":void 0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"0.75rem"},children:[e.jsx("span",{className:"icon-badge",style:{flexShrink:0},children:e.jsx("i",{className:"bi bi-ballot"})}),e.jsxs("div",{style:{flex:1},children:[e.jsx("h3",{style:{margin:0,fontSize:"1rem"},children:s.title}),s.description&&e.jsx("p",{style:{margin:"0.25rem 0 0",fontSize:"0.875rem",color:"var(--color-text-muted)"},children:s.description})]}),s.alreadyVoted&&e.jsxs("span",{className:"badge badge-success",style:{flexShrink:0},children:[e.jsx("i",{className:"bi bi-check2-circle"})," رأی ثبت شد"]})]}),e.jsxs("div",{style:{display:"flex",gap:"1rem",fontSize:"0.82rem",color:"var(--color-text-muted)"},children:[s.startsAt!=="—"&&e.jsxs("span",{children:[e.jsx("i",{className:"bi bi-calendar-event",style:{marginLeft:"0.3rem"}}),"از ",s.startsAt]}),s.endsAt!=="—"&&e.jsxs("span",{children:[e.jsx("i",{className:"bi bi-calendar-x",style:{marginLeft:"0.3rem"}}),"تا ",s.endsAt]})]}),s.alreadyVoted?e.jsxs("div",{style:{alignItems:"center",background:"white",border:"1px solid var(--color-primary-soft)",borderRadius:"var(--radius-sm)",color:"var(--color-primary-active)",display:"flex",gap:"0.4rem",fontSize:"0.875rem",fontWeight:700,padding:"0.6rem 0.9rem"},children:[e.jsx("i",{className:"bi bi-check-circle-fill"}),"شما در این رأی‌گیری شرکت کرده‌اید"]}):e.jsxs(a,{href:`/student/voting/${s.id}`,className:"btn btn-primary",style:{textAlign:"center"},children:[e.jsx("i",{className:"bi bi-hand-index"})," شرکت در رأی‌گیری"]})]},s.id))})]})})}export{d as default};
