import{jsxs as t,jsx as e}from"react/jsx-runtime";import{F as m}from"./layout-kzl3pk8B.js";import{Head as h}from"@inertiajs/react";import{C as p}from"./class-icon-CASn9-jM.js";import{T as f,a as x,b as i,c as s,d as g,e as a}from"./table-BrXe3s2z.js";import{B as c}from"./button-BvFBRYHq.js";import{ChevronLeft as u,ChevronRight as N}from"lucide-react";import{B as b}from"./badge-CFi7bqqA.js";import{c as v}from"./utils-CMbmcP35.js";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-slot";import"class-variance-authority";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";import"clsx";import"tailwind-merge";const w=[{title:"Dashboard",href:"/dashboard"},{title:"Ranking",href:"#"},{title:"PVP",href:"/dashboard/ranking/pvp"}];function se({players:l,pagination:o}){const n=o.current_page,d=r=>r>=3?"text-green-500":r>=1.5?"text-blue-500":r>=1?"text-yellow-500":"text-red-500";return t(m,{breadcrumbs:w,children:[e(h,{title:"PVP Ranking"}),t("div",{className:"flex h-full flex-1 flex-col space-y-8 p-4 md:p-8",children:[t("div",{className:"flex flex-col gap-1",children:[e("h1",{className:"text-xl font-bold tracking-tight",children:"PVP Ranking"}),e("p",{className:"text-sm text-muted-foreground",children:"Top PVP players ranked by kills and K/D ratio"})]}),t("div",{className:"rounded-xl border bg-card text-card-foreground shadow-sm overflow-x-auto",children:[t(f,{children:[e(x,{children:t(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:"text-center w-[100px]",children:"Kills"}),e(s,{className:"text-center w-[100px]",children:"Deaths"}),e(s,{className:"text-right",children:"K/D Ratio"})]})}),t(g,{children:[l.map(r=>t(i,{className:"hover:bg-muted/50",children:[e(a,{className:"text-center font-medium text-muted-foreground",children:r.rank}),e(a,{children:e("span",{className:"font-semibold text-foreground",children:r.name})}),e(a,{children:t("div",{className:"flex items-center gap-2",children:[e(p,{classId:r.class,size:"sm"}),e("span",{className:"text-sm text-muted-foreground",children:r.class_name})]})}),e(a,{className:"text-center",children:e(b,{variant:"secondary",className:"font-mono font-normal",children:r.kills.toLocaleString()})}),e(a,{className:"text-center",children:e("span",{className:"font-mono text-sm text-muted-foreground",children:r.deaths.toLocaleString()})}),e(a,{className:"text-right",children:e("span",{className:v("font-mono font-medium",d(r.kdr)),children:r.kdr.toFixed(2)})})]},r.id)),l.length===0&&e(i,{children:e(a,{colSpan:6,className:"h-24 text-center",children:"No PVP data found."})})]})]}),t("div",{className:"flex items-center justify-between px-4 py-4 border-t bg-muted/20",children:[t("div",{className:"text-xs text-muted-foreground",children:["Showing ",e("strong",{children:o.current_page})," of ",e("strong",{children:o.total_pages})," pages"]}),t("div",{className:"flex items-center gap-2",children:[t(c,{variant:"ghost",size:"sm",disabled:n<=1,onClick:()=>{window.location.href=`/dashboard/ranking/pvp?page=${n-1}`},className:"h-8 w-8 p-0",children:[e(u,{className:"h-4 w-4"}),e("span",{className:"sr-only",children:"Previous"})]}),t(c,{variant:"ghost",size:"sm",disabled:n>=o.total_pages,onClick:()=>{window.location.href=`/dashboard/ranking/pvp?page=${n+1}`},className:"h-8 w-8 p-0",children:[e(N,{className:"h-4 w-4"}),e("span",{className:"sr-only",children:"Next"})]})]})]})]})]})]})}export{se as default};
