'use client' import { useState } from 'react' export type ReputationEntry = { faction: number name: string standing: number rank: string rankIndex: number color: string cur: number max: number } /** Pestaña de Reputaciones: búsqueda en tiempo real + paginación + barra de rango/progreso. */ export function ArmoryReputations({ reputations, pageSize, labels, }: { reputations: ReputationEntry[] pageSize: number labels: { title: string; search: string; empty: string } }) { const [q, setQ] = useState('') const [page, setPage] = useState(1) const query = q.trim().toLowerCase() const filtered = query ? reputations.filter((r) => r.name.toLowerCase().includes(query)) : reputations const pages = Math.max(1, Math.ceil(filtered.length / pageSize)) const p = Math.min(page, pages) const pageItems = filtered.slice((p - 1) * pageSize, (p - 1) * pageSize + pageSize) const win = 2 const from = Math.max(1, p - win) const to = Math.min(pages, p + win) const nums: number[] = [] for (let i = from; i <= to; i++) nums.push(i) return (
{labels.empty}
) : (