'use client'; import shared from '../../styles/shared.module.css'; import styles from '../../styles/Customizations.module.css'; import { CustomizationItem, CATEGORY_LABELS, CATEGORY_ORDER, getCosmeticIconUrl } from './types'; type Props = { charName: string; charCosmetics: Record; unlockedSet: Set; characterMap: Map; onBack: () => void; onUnlockAll: () => void; onLockAll: () => void; onToggle: (id: string) => void; }; export default function CharacterCosmetics({ charName, charCosmetics, unlockedSet, characterMap, onBack, onUnlockAll, onLockAll, onToggle }: Props) { const allItems = Object.values(charCosmetics).flat(); const unlockedCount = allItems.filter((i) => unlockedSet.has(i.id)).length; return (
{charName} {unlockedCount} / {allItems.length} unlocked
{CATEGORY_ORDER.filter((cat) => charCosmetics[cat]?.length > 0).map( (cat) => (
{CATEGORY_LABELS[cat] ?? `Category ${cat}`}
{charCosmetics[cat].map((item) => { const unlocked = unlockedSet.has(item.id); return (
onToggle(item.id)} > {item.name} {item.name}
); })}
) )}
); }