import{jsxs as r,jsx as e}from"react/jsx-runtime";import{C as p}from"./class-icon-CASn9-jM.js";import{B as f}from"./badge-CFi7bqqA.js";import{B as d}from"./button-BvFBRYHq.js";import{T as x,a as g,b as i,c as s,d as u,e as a}from"./table-BrXe3s2z.js";import{F as N}from"./layout-kzl3pk8B.js";import{Head as b}from"@inertiajs/react";import{Clock as v,ChevronLeft as w,ChevronRight as k}from"lucide-react";import"./utils-CMbmcP35.js";import"clsx";import"tailwind-merge";import"@radix-ui/react-slot";import"class-variance-authority";import"./app-sidebar-header-BX2s-HO_.js";import"react";import"@radix-ui/react-collapsible";import"./dropdown-menu-BP80qPHw.js";import"@radix-ui/react-dropdown-menu";import"./app-logo-icon-beRg1XGs.js";import"./fonts-CqawFh47.js";import"@radix-ui/react-dialog";import"@radix-ui/react-tooltip";import"@radix-ui/react-avatar";import"../app.js";/* empty css     */import"axios";import"sonner";import"react-dom/client";import"./main-CWwoxgdq.js";import"./toaster-DuLpwsc2.js";import"./WelcomeModal-BFw-aFh5.js";import"./dialog-BfGkTFdF.js";import"./label-DMnntKPk.js";import"@radix-ui/react-label";import"./checkbox-DXBO59MA.js";import"@radix-ui/react-checkbox";const C=[{title:"Dashboard",href:"/dashboard"},{title:"Ranking",href:"#"},{title:"Player",href:"/dashboard/ranking/player"}];function oe({players:l,pagination:n,fromCache:m=!1,lastSyncTime:c}){const o=n.current_page,h=t=>t>=1e6?(t/1e6).toFixed(1)+"M":t>=1e3?(t/1e3).toFixed(1)+"K":t.toString();return r(N,{breadcrumbs:C,children:[e(b,{title:"Player Ranking"}),r("div",{className:"flex h-full flex-1 flex-col space-y-8 p-4 md:p-8",children:[r("div",{className:"flex flex-col gap-1",children:[e("h1",{className:"text-xl font-bold tracking-tight",children:"Player Ranking"}),e("p",{className:"text-muted-foreground text-sm",children:"Top players ranked by reputation and level"})]}),m&&c&&r("div",{className:"text-muted-foreground flex items-center gap-1 text-xs",children:[e(v,{className:"h-3 w-3"}),"Last updated ",c]}),r("div",{className:"bg-card text-card-foreground overflow-x-auto rounded-xl border shadow-sm",children:[r(x,{children:[e(g,{children:r(i,{className:"hover:bg-transparent",children:[e(s,{className:"w-[80px] text-center",children:"#"}),e(s,{children:"Character"}),e(s,{children:"Class"}),e(s,{className:"w-[100px] text-center",children:"Level"}),e(s,{className:"text-right",children:"Reputation"}),e(s,{className:"text-right",children:"Faction"})]})}),r(u,{children:[l.map(t=>r(i,{className:"hover:bg-muted/50",children:[e(a,{className:"text-muted-foreground text-center font-medium",children:t.rank}),e(a,{children:e("span",{className:"text-foreground font-semibold",children:t.name})}),e(a,{children:r("div",{className:"flex items-center gap-2",children:[e(p,{classId:t.class,size:"sm"}),e("span",{className:"text-muted-foreground text-sm",children:t.class_name})]})}),e(a,{className:"text-center",children:e("span",{className:"font-mono text-sm",children:t.level})}),e(a,{className:"text-right",children:e("span",{className:"font-mono font-medium",children:h(t.reputation)})}),e(a,{className:"text-right",children:t.faction_name?e(f,{variant:"secondary",className:"font-normal",children:t.faction_name}):e("span",{className:"text-muted-foreground text-xs",children:"-"})})]},t.id)),l.length===0&&e(i,{children:e(a,{colSpan:6,className:"h-24 text-center",children:"No players found."})})]})]}),r("div",{className:"bg-muted/20 flex items-center justify-between border-t px-4 py-4",children:[r("div",{className:"text-muted-foreground text-xs",children:["Showing ",e("strong",{children:n.current_page})," of ",e("strong",{children:n.total_pages})," pages"]}),r("div",{className:"flex items-center gap-2",children:[r(d,{variant:"ghost",size:"sm",disabled:o<=1,onClick:()=>{window.location.href=`/dashboard/ranking/player?page=${o-1}`},className:"h-8 w-8 p-0",children:[e(w,{className:"h-4 w-4"}),e("span",{className:"sr-only",children:"Previous"})]}),r(d,{variant:"ghost",size:"sm",disabled:o>=n.total_pages,onClick:()=>{window.location.href=`/dashboard/ranking/player?page=${o+1}`},className:"h-8 w-8 p-0",children:[e(k,{className:"h-4 w-4"}),e("span",{className:"sr-only",children:"Next"})]})]})]})]})]})]})}export{oe as default};
