You've already forked Atomcms-edit
1 line
4.2 KiB
JavaScript
Executable File
1 line
4.2 KiB
JavaScript
Executable File
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,13979,e=>{"use strict";var t=e.i(43476),s=e.i(71645),a=e.i(22016),l=e.i(57688),r=e.i(88589),i=e.i(13642),d=e.i(9165);e.s(["default",0,function(){let[e,c]=(0,s.useState)(null),[n,x]=(0,s.useState)(!0),[o,m]=(0,s.useState)("rich");return(0,s.useEffect)(()=>{!async function(){let{data:e}=await d.api.get("/leaderboard");e&&c(e),x(!1)}()},[]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.default,{}),(0,t.jsx)("main",{className:"bg-background min-h-screen",children:(0,t.jsxs)("div",{className:"max-w-7xl mx-auto p-4 lg:p-6",children:[(0,t.jsx)("div",{className:"bg-surface rounded-lg shadow-card p-4 md:p-6 mb-6",children:(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("div",{className:"w-12 h-12 rounded-full bg-primary flex items-center justify-center",children:(0,t.jsx)("svg",{className:"w-6 h-6 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-2xl md:text-3xl font-bold text-text-main",children:"Leaderboard"}),(0,t.jsx)("p",{className:"text-text-muted",children:"Bekijk de top gebruikers van het hotel"})]})]})}),(0,t.jsx)("div",{className:"flex gap-2 mb-6 overflow-x-auto pb-2",children:[{id:"rich",label:"Rijkste"},{id:"online",label:"Meeste uur online"},{id:"respect",label:"Meeste respect"}].map(e=>(0,t.jsx)("button",{onClick:()=>m(e.id),className:`px-4 py-2 rounded-lg font-semibold whitespace-nowrap transition-colors ${o===e.id?"bg-primary text-text-main":"bg-surface text-text-muted hover:bg-gray-100"}`,children:e.label},e.id))}),n?(0,t.jsx)("div",{className:"bg-surface rounded-lg shadow-card p-8 text-center",children:(0,t.jsx)("p",{className:"text-text-muted",children:"Laden..."})}):e?(0,t.jsx)("div",{className:"bg-surface rounded-lg shadow-card overflow-hidden",children:(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full",children:[(0,t.jsx)("thead",{className:"bg-background",children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{className:"px-4 py-3 text-left text-sm font-semibold text-text-muted",children:"Rank"}),(0,t.jsx)("th",{className:"px-4 py-3 text-left text-sm font-semibold text-text-muted",children:"Gebruiker"}),(0,t.jsxs)("th",{className:"px-4 py-3 text-right text-sm font-semibold text-text-muted",children:["rich"===o&&"Credits","online"===o&&"Uren","respect"===o&&"Respect"]})]})}),(0,t.jsx)("tbody",{className:"divide-y divide-gray-100",children:e[o]?.map((e,s)=>{var r,i;return(0,t.jsxs)("tr",{className:"hover:bg-background transition-colors",children:[(0,t.jsx)("td",{className:"px-4 py-3",children:(0,t.jsx)("span",{className:`text-lg font-bold ${1===(r=s+1)?"text-yellow-400":2===r?"text-gray-400":3===r?"text-orange-400":"text-text-muted"}`,children:1===(i=s+1)?"🥇":2===i?"🥈":3===i?"🥉":`#${i}`})}),(0,t.jsx)("td",{className:"px-4 py-3",children:(0,t.jsxs)(a.default,{href:`/profile/${e.username}`,className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"w-10 h-10 rounded-lg overflow-hidden bg-background relative",children:(0,t.jsx)(l.default,{src:`https://epicnabbo.nl/imaging/?figure=${e.look}&headonly=1&direction=2`,alt:e.username,fill:!0,className:"object-cover"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-semibold text-text-main",children:e.username}),e.motto&&(0,t.jsx)("p",{className:"text-xs text-text-muted truncate max-w-[200px]",children:e.motto})]})]})}),(0,t.jsx)("td",{className:"px-4 py-3 text-right",children:(0,t.jsxs)("span",{className:"font-bold text-primary",children:["rich"===o&&e.credits?.toLocaleString(),"online"===o&&e.online_time?.toLocaleString(),"respect"===o&&e.respect?.toLocaleString()]})})]},e.id)})})]})})}):(0,t.jsx)("div",{className:"bg-surface rounded-lg shadow-card p-8 text-center",children:(0,t.jsx)("p",{className:"text-text-muted",children:"Geen data beschikbaar"})})]})}),(0,t.jsx)(i.default,{})]})}])}]); |