import React from 'react' function formatXp(value) { return new Intl.NumberFormat().format(Number(value || 0)) } function clampPercent(value) { const numeric = Number(value || 0) if (!Number.isFinite(numeric)) return 0 return Math.max(0, Math.min(100, numeric)) } function cx(...parts) { return parts.filter(Boolean).join(' ') } export default function XPProgressBar({ xp = 0, currentLevelXp = 0, nextLevelXp = 100, progressPercent = 0, maxLevel = false, className = '', }) { const percent = maxLevel ? 100 : clampPercent(progressPercent) return (