'use client'; import shared from '../../styles/shared.module.css'; import styles from '../../styles/Customizations.module.css'; import { DB_BASE_URL } from '../../lib/db'; import { Character, RoleFilter } from './types'; type Props = { filteredChars: Character[]; charSearch: string; charRole: RoleFilter; charFullyUnlocked: Map; onSelect: (idx: number) => void; onSearchChange: (s: string) => void; onRoleChange: (r: RoleFilter) => void; onUnlockShownCosmetics: () => void; onLockShownCosmetics: () => void; }; const getCharIconUrl = (iconFilePath: string) => { const file = (iconFilePath.split('/').pop() ?? '').split('.')[0]; return `${DB_BASE_URL}/icons/character-icons/${file}.png`; }; export default function CharacterPicker({ filteredChars, charSearch, charRole, charFullyUnlocked, onSelect, onSearchChange, onRoleChange, onUnlockShownCosmetics, onLockShownCosmetics, }: Props) { return ( <>
onSearchChange(e.target.value)} />
{(['all', 'survivors', 'killers'] as RoleFilter[]).map(r => ( ))}
{filteredChars.length} shown
{filteredChars.map(char => { const fullyUnlocked = charFullyUnlocked.get(char.idx) ?? false; return (
onSelect(char.idx)} > {char.name} {char.name}
); })}
); }