import { SwitchMiiInstructions } from "@/types"; import { useState } from "react"; import ColorPicker from "../color-picker"; import TypeSelector from "../type-selector"; import NumberInputs from "../number-inputs"; interface Props { instructions: React.RefObject; } const TABS: { name: keyof SwitchMiiInstructions["eyes"]; length: number; colorsDisabled?: number[] }[] = [ { name: "eyesType", length: 50 }, { name: "eyelashesTop", length: 40 }, { name: "eyelashesBottom", length: 20 }, { name: "eyelidTop", length: 10 }, { name: "eyelidBottom", length: 5 }, { name: "eyeliner", length: 15 }, { name: "pupil", length: 3 }, ]; export default function OtherTab({ instructions }: Props) { const [tab, setTab] = useState(0); // One type/color state per tab const [types, setTypes] = useState(Array(TABS.length).fill(0)); const [colors, setColors] = useState(Array(TABS.length).fill(0)); const currentTab = TABS[tab]; const setType = (value: number) => { setTypes((prev) => { const copy = [...prev]; copy[tab] = value; return copy; }); instructions.current.eyes[currentTab.name] = value; }; const setColor = (value: number) => { setColors((prev) => { const copy = [...prev]; copy[tab] = value; return copy; }); // TODO: check in actual game, temp instructions.current.eyes.color = value; }; return (

Other

{TABS.map((_, i) => ( ))}
); }