import { useMemo, useState } from 'react'; import { FIGHTERS, fighterInitials } from '@sbt/shared'; /** * Placeholder character picker — renders initial chips for the full SSBU roster. * Swap the chip for a real stock icon later by mapping the fighter id to an image. */ export function CharacterPicker({ value, onChange }: { value: string; onChange: (id: string) => void }) { const [open, setOpen] = useState(false); const [q, setQ] = useState(''); const filtered = useMemo( () => FIGHTERS.filter((f) => f.toLowerCase().includes(q.toLowerCase())), [q], ); return (
{open && (
setQ(e.target.value)} placeholder="Search fighters…" className="mb-2 w-full rounded border border-edge bg-ink px-2 py-1 text-sm outline-none" />
{ onChange(id); setOpen(false); }} /> {filtered.map((f) => ( { onChange(id); setOpen(false); }} /> ))}
)}
); } function Chip({ label, id, active, onPick }: { label: string; id: string; active: boolean; onPick: (id: string) => void }) { return ( ); }