1import{r as c,a as x,j as e,S as h,L as p,A as b}from"./index-DU7EiW5Z.js";import{C as u}from"./CommunityLayout-yLlWUrHy.js";import{P as j}from"./PageBreadcrumbs-C6_7Alzf.js";import{T as l}from"./trophy-9c_RsmM1.js";import{C as g}from"./Header-dH_zm7gK.js";import{S as f}from"./share-2-Tq0ngf2K.js";import{M as N}from"./medal-ffbwHuBa.js";import{A as v}from"./award-Btlu5Xqu.js";import"./Footer-CcSM9az0.js";import"./index-CUko9iY5.js";import"./mail-kXcN9TSZ.js";import"./circle-question-mark-BM3yB2OI.js";import"./lightbulb-WKC2Tcly.js";import"./house-CXnXROsz.js";import"./pencil-5paIu0BF.js";import"./BackToTop-DByhqIJJ.js";import"./arrow-up-Nc3LYYRG.js";import"./index-D7TqL6Li.js";import"./check-DnvdljkK.js";import"./index-ChbWPcUi.js";import"./badge-DAERl6XE.js";import"./Normal_(1)_1770767936075-DWlfSefL.js";import"./arrow-left-Duva7iIn.js";import"./video-CfxPEA4p.js";function X(){const[r,i]=c.useState("month"),{data:t,isLoading:m}=x({queryKey:[`/api/community/leaderboard?period=${r}`]});return e.jsxs(u,{children:[e.jsx(j,{items:[{label:"Home",href:"/"},{label:"Community",href:"/community"},{label:"Leaderboard"}],className:"mb-4"}),e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-[26px] font-bold text-slate-800",children:"Community Leaderboard"}),e.jsx("p",{className:"text-slate-500 mt-1",children:"Recognising our most helpful community members"})]}),e.jsx("div",{className:"flex gap-2 mb-8",children:[{value:"week",label:"This Week"},{value:"month",label:"This Month"},{value:"all",label:"All Time"}].map(s=>e.jsx("button",{onClick:()=>i(s.value),className:`px-4 py-2 rounded-lg text-sm font-medium transition-colors ${r===s.value?"bg-blue-600 text-white":"bg-slate-100 text-slate-600 hover:bg-slate-200"}`,children:s.label},s.value))}),m?e.jsx("div",{className:"space-y-4",children:[1,2,3].map(s=>e.jsx("div",{className:"animate-pulse h-16 bg-slate-100 rounded-xl"},s))}):t?.length?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-8",children:t.slice(0,3).map((s,a)=>{const d=["bg-amber-50 border-amber-200","bg-slate-50 border-slate-200","bg-orange-50 border-orange-200"],n=[e.jsx(l,{className:"w-6 h-6 text-amber-500"}),e.jsx(N,{className:"w-6 h-6 text-slate-400"}),e.jsx(v,{className:"w-6 h-6 text-orange-400"})],o=["ring-amber-400","ring-slate-300","ring-orange-300"];return e.jsxs("div",{className:`${d[a]} border rounded-xl p-5 text-center`,children:[e.jsx("div",{className:"flex justify-center mb-3",children:n[a]}),e.jsx("div",{className:`w-16 h-16 rounded-full mx-auto mb-3 ring-4 ${o[a]} overflow-hidden bg-gradient-to-br from-blue-400 to-blue-600 flex items-center justify-center text-white text-xl font-bold`,children:s.userImage?e.jsx("img",{src:s.userImage,alt:"",className:"w-16 h-16 rounded-full object-cover"}):s.userName?.[0]?.toUpperCase()||"?"}),e.jsx("h3",{className:"font-semibold text-slate-800 text-base",children:s.userName}),e.jsx("p",{className:"text-2xl font-bold text-blue-600 mt-1",children:s.totalPoints}),e.jsx("p",{className:"text-xs text-slate-400",children:"points"})]},s.userId)})}),t.length>3&&e.jsx("div",{className:"border border-slate-200 rounded-xl overflow-hidden",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-slate-50 text-xs font-medium text-slate-500 uppercase tracking-wider",children:[e.jsx("th",{className:"px-4 py-3 text-left",children:"Rank"}),e.jsx("th",{className:"px-4 py-3 text-left",children:"Member"}),e.jsx("th",{className:"px-4 py-3 text-center",children:"Threads"}),e.jsx("th",{className:"px-4 py-3 text-center",children:"Replies"}),e.jsx("th",{className:"px-4 py-3 text-center",children:"Likes"}),e.jsx("th",{className:"px-4 py-3 text-center",children:"Points"})]})}),e.jsx("tbody",{className:"divide-y divide-slate-100",children:t.slice(3).map(s=>e.jsxs("tr",{className:"hover:bg-slate-50",children:[e.jsxs("td",{className:"px-4 py-3 text-sm font-medium text-slate-600",children:["#",s.rank]}),e.jsx("td",{className:"px-4 py-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-gradient-to-br from-blue-400 to-blue-600 flex items-center justify-center text-white text-xs font-medium overflow-hidden",children:s.userImage?e.jsx("img",{src:s.userImage,alt:"",className:"w-8 h-8 rounded-full object-cover"}):s.userName?.[0]?.toUpperCase()||"?"}),e.jsx("span",{className:"text-sm font-medium text-slate-700",children:s.userName})]})}),e.jsx("td",{className:"px-4 py-3 text-sm text-slate-500 text-center",children:s.threadsCount}),e.jsx("td",{className:"px-4 py-3 text-sm text-slate-500 text-center",children:s.repliesCount}),e.jsx("td",{className:"px-4 py-3 text-sm text-slate-500 text-center",children:s.likesReceived}),e.jsx("td",{className:"px-4 py-3 text-sm font-semibold text-blue-600 text-center",children:s.totalPoints})]},s.userId))})]})})]}):e.jsxs("div",{className:"text-center py-16 text-slate-400",children:[e.jsx(l,{className:"w-12 h-12 mx-auto mb-3 opacity-50"}),e.jsx("p",{className:"text-lg font-medium",children:"No leaderboard data yet"}),e.jsx("p",{className:"text-sm",children:"Start participating in the community to earn points!"})]}),e.jsxs("div",{className:"mt-8 grid md:grid-cols-2 gap-4",children:[e.jsx("div",{className:"bg-gradient-to-br from-amber-50 via-orange-50 to-rose-50 border border-amber-200 rounded-xl p-6",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"flex items-center justify-center w-11 h-11 rounded-full bg-white/80 shadow-sm",children:e.jsx(h,{className:"w-5 h-5 text-amber-500"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-slate-800",children:"Earn a weekly badge"}),e.jsx("p",{className:"text-sm text-slate-600 mt-1",children:"Every Tuesday, the top 25 contributors of the week earn a digital badge with a public, shareable link. Top 3 finishers get medal badges to post on X, LinkedIn, Facebook, WhatsApp, and Reddit."}),e.jsxs("div",{className:"flex items-center gap-2 mt-3 text-sm",children:[e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-white/80 text-amber-700 font-medium",children:[e.jsx(g,{size:12})," Weekly"]}),e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-white/80 text-amber-700 font-medium",children:[e.jsx(l,{size:12})," Top 25 win"]}),e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-white/80 text-amber-700 font-medium",children:[e.jsx(f,{size:12})," One-tap share"]})]}),e.jsxs(p,{href:"/community",className:"inline-flex items-center gap-1 mt-3 text-sm font-medium text-amber-700 hover:underline",children:["Start earning points ",e.jsx(b,{size:14})]})]})]})}),e.jsxs("div",{className:"bg-slate-50 rounded-xl p-6",children:[e.jsx("h3",{className:"font-semibold text-slate-800 mb-3",children:"How points work"}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 text-slate-600",children:[e.jsx("span",{className:"font-bold text-blue-600",children:"+5"})," Start a thread"]}),e.jsxs("div",{className:"flex items-center gap-2 text-slate-600",children:[e.jsx("span",{className:"font-bold text-blue-600",children:"+3"})," Post a reply"]}),e.jsxs("div",{className:"flex items-center gap-2 text-slate-600",children:[e.jsx("span",{className:"font-bold text-blue-600",children:"+2"})," Receive a like"]}),e.jsxs("div",{className:"flex items-center gap-2 text-slate-600",children:[e.jsx("span",{className:"font-bold text-blue-600",children:"+10"})," Accepted answer"]})]}),e.jsx("p",{className:"text-xs text-slate-500 mt-3",children:"Weekly leaderboards reset every Tuesday at 06:00 UTC. Monthly leaderboards reset on the 1st of each month."})]})]})]})}export{X 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.