"use client"; import type { HSL } from "@/lib/character/color-utils"; import { PIECE_SLOT_COUNT } from "@/lib/character/presets"; import { cn } from "@/lib/utils"; import type { LayerVariant } from "@/lib/character/presets"; import { TintedSpriteIcon } from "./tinted-sprite-icon"; type CharacterPieceSelectorProps = { variants: LayerVariant[]; activeId: string; color: HSL; onSelect: (variantId: string) => void; }; export function CharacterPieceSelector({ variants, activeId, color, onSelect, }: CharacterPieceSelectorProps) { const slots = Array.from({ length: PIECE_SLOT_COUNT }, (_, index) => variants[index] ?? null, ); return (