1import{av as b,aW as f,aX as j,j as e,a7 as N,Q as d,g as v,e as w,ap as n,C as y,aR as o,A as _,a0 as k}from"./index-CyZ-pQAp.js";import{T as C}from"./target-DJoMdBMW.js";import{C as A}from"./calendar-C803Nn6o.js";import{v as c}from"./vi-DxAQwiEv.js";const L={"68616f3e-1549-4658-a953-77552d2de9c8":"/thu-thach","9bd3ac06-02c5-43fd-8ac3-c39684eb3410":"/giai-phong-trainer"};function H(){const{data:h,isLoading:m}=b(),s=(h||[]).filter(a=>a.id!==f),{data:r}=j(),x=a=>!!r&&(r.isAdmin||r.isFullMember||r.challengeIds.has(a));return e.jsxs("div",{className:"space-y-6 pb-12",children:[e.jsxs("div",{className:"rounded-2xl border border-[hsl(45_95%_55%/0.22)] bg-gradient-to-br from-[hsl(45_95%_55%/0.06)] via-card/40 to-transparent p-6 md:p-8 backdrop-blur-sm",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full text-xs font-semibold mb-3 border border-[hsl(45_95%_55%/0.4)] bg-[hsl(45_95%_55%/0.08)] text-notion-yellow",children:[e.jsx(N,{className:"h-3.5 w-3.5"}),"Thá» thách"]}),e.jsxs("h1",{className:"text-3xl md:text-4xl font-bold leading-tight tracking-tight",children:["Danh sách ",e.jsx("span",{className:"text-notion-yellow",children:"Thá» Thách"})," ð"]}),e.jsx("p",{className:"text-muted-foreground mt-2 text-base",children:"Chá»n 1 thá» thách Äá» bắt Äầu hà nh trình build há» thá»ng cá»§a bạn."})]}),m?e.jsx("div",{className:"grid sm:grid-cols-2 gap-4",children:[1,2,3,4].map(a=>e.jsx("div",{className:"rounded-2xl border border-border bg-card h-72 animate-pulse"},a))}):s!=null&&s.length?e.jsx("div",{className:"grid sm:grid-cols-2 gap-5",children:s.map(a=>{var i;const g=((i=a.challenge_tasks)==null?void 0:i.length)||0,l=a.status==="active",t=x(a.id),p=L[a.id]||"/thu-thach",u=t?`/app/challenges/${a.id}`:p;return e.jsxs(v,{to:u,className:"group rounded-2xl border border-border bg-card overflow-hidden hover:border-primary/60 hover:shadow-[0_0_24px_hsl(var(--primary)/0.18)] transition-all flex flex-col",children:[e.jsxs("div",{className:"relative w-full aspect-[16/9] bg-gradient-to-br from-primary/20 via-card to-accent/10 overflow-hidden",children:[a.cover_image_url?e.jsx("img",{src:a.cover_image_url,alt:a.title,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500",loading:"lazy"}):e.jsx("div",{className:"w-full h-full flex items-center justify-center",children:e.jsx(d,{className:"h-14 w-14 text-primary/50"})}),!t&&e.jsxs("div",{className:"absolute inset-0 bg-background/70 backdrop-blur-[2px] flex flex-col items-center justify-center gap-2",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-amber-500/20 border border-amber-500/40 flex items-center justify-center",children:e.jsx(w,{className:"h-5 w-5 text-amber-300"})}),e.jsx("span",{className:"text-xs font-semibold text-amber-100 uppercase tracking-wider",children:"Chưa má» khoá"})]}),e.jsx("div",{className:"absolute top-3 left-3 flex items-center gap-2",children:e.jsx(n,{variant:l?"default":"secondary",className:l?"bg-primary text-primary-foreground shadow-lg":"shadow-lg",children:l?"Äang diá»
n ra":"Sắp khai giảng"})}),t&&e.jsx("div",{className:"absolute top-3 right-3",children:e.jsxs(n,{className:"bg-emerald-500/90 text-white border-0 gap-1 shadow-lg",children:[e.jsx(y,{className:"h-3 w-3"})," Äã má»"]})})]}),e.jsxs("div",{className:"p-5 flex flex-col gap-3 flex-1",children:[e.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:e.jsxs(n,{variant:"outline",className:"gap-1",children:[e.jsx(C,{className:"h-3 w-3"})," ",g," nhiá»m vụ"]})}),e.jsx("h3",{className:"text-xl font-black leading-snug group-hover:text-primary transition-colors",children:a.title}),a.description&&e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-3 leading-relaxed",children:a.description}),e.jsxs("div",{className:"mt-auto flex items-center justify-between pt-3 border-t border-border/60 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx(A,{className:"h-3.5 w-3.5"}),o(new Date(a.start_at),"d MMM",{locale:c})," â"," ",o(new Date(a.end_at),"d MMM yyyy",{locale:c})]}),t?e.jsxs("span",{className:"inline-flex items-center gap-1 font-semibold text-primary group-hover:translate-x-1 transition-transform",children:["Và o há»c ",e.jsx(_,{className:"h-3.5 w-3.5"})]}):e.jsxs("span",{className:"inline-flex items-center gap-1 font-semibold text-notion-yellow group-hover:translate-x-1 transition-transform",children:[e.jsx(k,{className:"h-3.5 w-3.5"})," ÄÄng ký"]})]})]})]},a.id)})}):e.jsxs("div",{className:"rounded-2xl border border-dashed border-border bg-card/30 p-10 text-center",children:[e.jsx(d,{className:"h-10 w-10 text-muted-foreground mx-auto mb-3"}),e.jsx("p",{className:"text-muted-foreground",children:"Chưa có thá» thách nà o Äang diá»
n ra. Hãy quay lại sau nhé!"})]})]})}export{H as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.