"use client"; import { Lock } from "lucide-react"; import { PIECE_SLOT_COUNT } from "@/lib/character/presets"; import { ROOM_BACKGROUNDS, isRoomBackgroundUnlocked, type RoomBackgroundId, } from "@/lib/room-backgrounds"; import { cn } from "@/lib/utils"; type RoomStyleSelectorProps = { activeId: RoomBackgroundId; ownedItemIds: readonly string[]; onSelect: (roomId: RoomBackgroundId) => void; onLockedSelect?: (roomId: RoomBackgroundId) => void; }; export function RoomStyleSelector({ activeId, ownedItemIds, onSelect, onLockedSelect, }: RoomStyleSelectorProps) { const slots = Array.from({ length: PIECE_SLOT_COUNT }, (_, index) => ROOM_BACKGROUNDS[index] ?? null, ); return (
{slots.map((room, index) => { if (!room) { return (
); } const locked = !isRoomBackgroundUnlocked(room.id, ownedItemIds); return ( ); })}
); }