diff --git a/frontend/src/components/ModeSwitch.tsx b/frontend/src/components/ModeSwitch.tsx index 47d6c43..de1601d 100644 --- a/frontend/src/components/ModeSwitch.tsx +++ b/frontend/src/components/ModeSwitch.tsx @@ -1,6 +1,8 @@ /** * The deck's two-way mode switch: two small stacked tabs in a well, the chosen * one lit. BEAT / MAN (loops) and HOT / MEM (the cue bank) are both this. + * With exactly two options a click anywhere on it flips to the other one; + * with more, each tab selects itself. */ export function ModeSwitch({ label, @@ -14,16 +16,18 @@ export function ModeSwitch({ options: { value: T; text: string; title: string }[] onChange: (value: T) => void }) { + const other = options.length === 2 ? options.find((o) => o.value !== value) : undefined return (
onChange(other.value) : undefined} + className={`well ${other ? 'cursor-pointer ' : ''}flex h-10 shrink-0 flex-col justify-center gap-0.5 rounded-[10px] p-0.5`} > {options.map((o) => (