1import{b as m,u as i,r as g,j as e}from"./index-C0By8LIB.js";import{C as x,a as u,b as h,c as p}from"./card-WtgdumPG.js";import{B as f}from"./badge-3ysFWthO.js";import{S as j}from"./skeleton-DVLjyIpd.js";import{S as y}from"./seo-BTvI9vkm.js";import{P as N}from"./PageContainer-EUZ4Z7Q8.js";import{L as k}from"./lock-CnihjR1q.js";import{C as v}from"./calendar-DaNi1GbZ.js";function E(){const{isAuthenticated:r}=m(),{data:n,isLoading:d}=i({queryKey:["/api/achievements/user"],enabled:r}),{data:t,isLoading:l}=i({queryKey:["/api/achievements"],enabled:!r}),o=r?n:t==null?void 0:t.map(s=>({...s,unlocked:!1,unlockedAt:null})),c=r?d:l;return g.useEffect(()=>{window.scrollTo({top:0,behavior:"smooth"})},[]),e.jsxs(e.Fragment,{children:[e.jsx(y,{title:"Your Achievements",description:"Track your longevity education achievements and unlock badges as you progress through AI Healthcare and Youth Health courses.",keywords:"achievements, learning badges, progress tracking, longevity milestones",canonicalUrl:"https://gcls.ai/achievements"}),e.jsx(N,{width:"default",spacing:"comfortable",children:e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-3xl md:text-4xl font-bold text-foreground",children:"Your Achievements"}),e.jsx("p",{className:"text-lg text-muted-foreground",children:"Unlock badges as you progress through your longevity journey"})]}),c?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:[...Array(8)].map((s,a)=>e.jsx(j,{className:"h-48 w-full"},a))}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6","data-testid":"grid-achievements",children:o==null?void 0:o.map(s=>{const a=s.unlocked;return e.jsxs(x,{className:`relative overflow-hidden ${a?"bg-gradient-to-br from-primary/5 to-accent/5 border-primary/20":"opacity-60"}`,"data-testid":`card-achievement-${s.id}`,children:[e.jsx(u,{children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsx("div",{className:"flex-1",children:e.jsxs(h,{className:"flex items-center gap-2 text-lg",children:[e.jsx("span",{className:"text-3xl",children:s.icon}),e.jsx("span",{children:s.title})]})}),!a&&e.jsxs(f,{variant:"secondary",className:"shrink-0",children:[e.jsx(k,{className:"w-3 h-3 mr-1"}),"Locked"]})]})}),e.jsxs(p,{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:s.description}),a&&s.unlockedAt&&e.jsx("div",{className:"pt-2 border-t",children:e.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[e.jsx(v,{className:"w-3 h-3"}),"Unlocked on"," ",new Date(s.unlockedAt).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"})]})})]})]},s.id)})})]})})]})}export{E 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.