import{u as d,j as r,T as c,P as h,I as g,B as x}from"./render-D1ZqzUbP.js";import{W as p}from"./WorkspacePremium-oZlDKw5g.js";import{T as f,a as m,b as u,c as n,d as i,e as j,f as b}from"./Base-Qt2-pbvB.js";import{L as y}from"./LinearProgress-a_GyCmbh.js";import"./formControlState-C1XOL3mQ.js";import"./Select-Ht3nAO4Q.js";import"./utils-VIUIl18e.js";import"./Button-DJ_uYab0.js";import"./Link-4dUp4u44.js";import"./Grid-BihMtcd8.js";import"./isMuiElement-BcEQvMml.js";function C({value:s,direction:a}){const t=Math.min(100,Math.max(0,s||0));return r.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1},children:[r.jsx(y,{variant:"determinate",value:t,sx:e=>({flex:1,height:8,borderRadius:4,backgroundColor:e.palette.mode==="light"?e.palette.grey[100]:e.palette.grey[800],"& .MuiLinearProgress-bar":{borderRadius:4}})}),r.jsxs(c,{variant:"body2",color:"text.secondary",sx:{minWidth:38,textAlign:a==="rtl"?"left":"right"},children:[t,"%"]})]})}function z({enrollments:s,selectHandler:a}){const{localeMessages:t,direction:e}=d();return s.length===0?r.jsx(c,{component:"span",children:t.nor_enrollments_found}):r.jsx(f,{component:h,sx:{maxHeight:300,border:"1px solid",borderColor:"grey.300",borderRadius:1},children:r.jsxs(m,{children:[r.jsx(u,{children:r.jsxs(n,{children:[r.jsx(i,{align:e=="rtl"?"right":"left",children:t.course}),r.jsx(i,{align:e=="rtl"?"right":"left",children:t.status}),r.jsx(i,{align:e=="rtl"?"right":"left",children:t.progress||"Progress"}),r.jsx(i,{align:e=="rtl"?"right":"left",children:t.certificate||"Certificate"})]})}),r.jsx(j,{children:s.map(o=>r.jsxs(n,{sx:l=>({":hover":{backgroundColor:l.palette.background.dark,cursor:"pointer",borderBottomColor:"primary.light",borderBottomWidth:2,borderBottomStyle:"solid"}}),onClick:()=>a(o.id),children:[r.jsx(i,{align:e=="rtl"?"right":"left",children:o.course_title}),r.jsx(i,{align:e=="rtl"?"right":"left",children:t[o.status]}),r.jsx(i,{align:e=="rtl"?"right":"left",sx:{minWidth:170},children:r.jsx(C,{value:o.progress,direction:e})}),r.jsx(i,{align:e=="rtl"?"right":"left",children:o.certificate_url?r.jsx(b,{title:t.certificate||"Certificate",children:r.jsx(g,{component:"a",href:o.certificate_url,rel:"noopener noreferrer",size:"small",onClick:l=>l.stopPropagation(),children:r.jsx(p,{fontSize:"small"})})}):null})]},o.id))})]})})}export{z as default};
//# sourceMappingURL=EnrollmentList-DFY4RlR9.js.map
