import{jsx as e,jsxs as r}from"react/jsx-runtime";import{memo as i}from"react";import{B as o}from"./badge-CFi7bqqA.js";import"@radix-ui/react-slot";import"class-variance-authority";import"./utils-CMbmcP35.js";import"clsx";import"tailwind-merge";const n=a=>a===1?"bg-yellow-100 text-yellow-800 border-yellow-300 dark:bg-yellow-900/60 dark:text-yellow-300 dark:border-yellow-700":a===2?"bg-gray-100 text-gray-800 border-gray-300 dark:bg-gray-700/60 dark:text-gray-300 dark:border-gray-600":a===3?"bg-orange-100 text-orange-800 border-orange-300 dark:bg-orange-900/60 dark:text-orange-300 dark:border-orange-700":"bg-blue-100 text-blue-800 border-blue-300 dark:bg-blue-900/60 dark:text-blue-300 dark:border-blue-700",f=i(function({pvpRankings:l,widgetBackgroundUrl:s}){return e("div",{className:"side-block rounded-lg border p-4",style:{backgroundImage:`url('${s||"/img/step/bg.webp"}')`,backgroundRepeat:"no-repeat",backgroundSize:"cover",backgroundColor:"transparent"},children:r("div",{className:"flex flex-col gap-3",children:[r("div",{className:"flex items-center gap-4",children:[e("div",{className:"flex-shrink-0",children:e("img",{src:"/img/step/pic-red-pvp.webp",alt:"PVP Icon",width:159,height:158,className:"h-16 w-auto"})}),e("h3",{className:"text-xl font-bold text-white tracking-widest",style:{fontFamily:"serif"},children:"PVP RANKINGS"})]}),e("div",{className:"w-full",children:l&&l.length>0?e("div",{className:"overflow-x-auto",children:r("table",{className:"w-full text-sm",children:[e("thead",{children:r("tr",{className:"border-b border-white/30",children:[e("th",{className:"text-left py-2 px-2 font-bold text-white/80 text-xs uppercase",children:"Rank"}),e("th",{className:"text-left py-2 px-2 font-bold text-white/80 text-xs uppercase",children:"Name"}),e("th",{className:"text-left py-2 px-2 font-bold text-white/80 text-xs uppercase",children:"Kill"}),e("th",{className:"text-left py-2 px-2 font-bold text-white/80 text-xs uppercase",children:"Death"})]})}),e("tbody",{children:l.slice(0,10).map(t=>r("tr",{className:"border-b border-white/10 hover:bg-white/5 transition-colors",children:[e("td",{className:"py-3 px-2",children:e(o,{variant:"outline",className:n(t.rank),children:t.rank})}),e("td",{className:"py-3 px-2",children:r("div",{className:"flex items-center gap-2",children:[e("img",{src:`/img/iconclass/${t.class_name.toLowerCase()}.webp`,alt:t.class_name,className:"w-6 h-6 object-contain",onError:d=>{d.currentTarget.style.display="none"}}),e("span",{className:"font-medium text-white",children:t.name})]})}),e("td",{className:"py-3 px-2",children:e("span",{className:"font-semibold text-green-500",children:t.kills})}),e("td",{className:"py-3 px-2",children:e("span",{className:"font-semibold text-red-500",children:t.deaths})})]},t.id))})]})}):r("div",{className:"text-center text-white/60 py-4",children:[e("p",{className:"font-medium",children:"No Rankings Yet"}),e("p",{className:"text-sm",children:"Be the first to compete!"})]})})]})})});export{f as RankingWidget};
