import{jsxs as a,jsx as e}from"react/jsx-runtime";import{B as n}from"./badge-CFi7bqqA.js";import{B as s}from"./button-BvFBRYHq.js";import{C as h,b as o,c as p,d as f,a as u}from"./card-Zg0WOx-j.js";import{I as P}from"./input-qMvM9qch.js";import{T,a as C,b as d,c as i,d as R,e as t}from"./table-BrXe3s2z.js";import{A as S}from"./layout-CssQHtfO.js";import{useForm as D,Head as _,Link as m}from"@inertiajs/react";import{ArrowLeft as B,Search as A,Eye as F,Trophy as H,Medal as I,Award as K}from"lucide-react";import"@radix-ui/react-slot";import"class-variance-authority";import"./utils-CMbmcP35.js";import"clsx";import"tailwind-merge";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"./toaster-DuLpwsc2.js";const V=[{title:"System",href:"#"},{title:"PVP",href:"/admin/system/pvp"},{title:"Ranking",href:"/admin/system/pvp/ranking"}];function ue({ranking:c,search:l}){const{data:N,setData:x,get:g,processing:y}=D({search:l||""}),v=r=>{r.preventDefault(),g("/admin/system/pvp/ranking",{preserveState:!0})},b=r=>r===1?e(H,{className:"h-5 w-5 text-yellow-500"}):r===2?e(I,{className:"h-5 w-5 text-gray-400"}):r===3?e(K,{className:"h-5 w-5 text-orange-600"}):r,k=r=>r>=2?e(n,{variant:"default",className:"bg-green-600",children:r.toFixed(2)}):r>=1?e(n,{variant:"secondary",children:r.toFixed(2)}):e(n,{variant:"destructive",children:r.toFixed(2)});return a(S,{breadcrumbs:V,children:[e(_,{title:"PVP Ranking"}),a("div",{className:"space-y-6",children:[a("div",{className:"flex items-center justify-between",children:[a("div",{children:[e("h1",{className:"text-1xl font-bold",children:"PVP Ranking"}),e("p",{className:"text-muted-foreground mt-1",children:"Top PVP players leaderboard"})]}),e(m,{href:"/admin/system/pvp",children:a(s,{variant:"outline",children:[e(B,{className:"mr-2 h-4 w-4"}),"Back to Dashboard"]})})]}),a(h,{children:[a(o,{children:[e(p,{children:"Search Players"}),e(f,{children:"Find specific players in the ranking"})]}),e(u,{children:a("form",{onSubmit:v,className:"flex gap-2",children:[e("div",{className:"flex-1",children:e(P,{type:"text",placeholder:"Search by player name...",value:N.search,onChange:r=>x("search",r.target.value)})}),a(s,{type:"submit",disabled:y,children:[e(A,{className:"h-4 w-4"}),e("span",{className:"ml-2 hidden md:inline",children:"Search"})]}),l&&e(m,{href:"/admin/system/pvp/ranking",children:a(s,{variant:"outline",children:[e(X,{className:"h-4 w-4"}),e("span",{className:"ml-2 hidden md:inline",children:"Clear"})]})})]})})]}),a(h,{children:[a(o,{children:[e(p,{children:"Player Rankings"}),a(f,{children:["Showing ",c.length," players ",l&&`matching "${l}"`]})]}),e(u,{children:a(T,{children:[e(C,{children:a(d,{children:[e(i,{className:"w-16",children:"Rank"}),e(i,{children:"Player"}),e(i,{className:"text-center",children:"ID"}),e(i,{className:"text-center",children:"Total Kills"}),e(i,{className:"text-center",children:"Unique Kills"}),e(i,{className:"text-center",children:"Deaths"}),e(i,{className:"text-center",children:"K/D Ratio"}),e(i,{className:"text-right",children:"Actions"})]})}),e(R,{children:c.length>0?c.map((r,w)=>a(d,{children:[e(t,{children:e("div",{className:"flex items-center",children:b(w+1)})}),e(t,{className:"font-medium",children:r.player_name||`Player_${r.player_id}`}),e(t,{className:"text-center",children:r.player_id}),e(t,{className:"text-center",children:e(n,{variant:"destructive",children:r.total_kills})}),e(t,{className:"text-center",children:r.unique_kills}),e(t,{className:"text-center",children:e(n,{variant:"secondary",children:r.deaths})}),e(t,{className:"text-center",children:k(r.kd_ratio)}),e(t,{className:"text-right",children:e(m,{href:`/admin/system/pvp/player/${r.player_id}`,children:a(s,{size:"sm",variant:"outline",children:[e(F,{className:"mr-2 h-4 w-4"}),"Details"]})})})]},r.player_id)):e(d,{children:e(t,{colSpan:8,className:"text-muted-foreground text-center",children:"No players found"})})})]})})]})]})]})}export{ue as default};
