"use client"; // A compact segmented control — the unit the Customize matrix is built from. // Touch-friendly, wraps on small screens, and can grey out individual options // (a disabled option that happens to be active still shows, just unclickable). export function Segmented({ label, value, options, onChange, }: { label: string; value: T; options: { value: T; label: string; disabled?: boolean }[]; onChange: (v: T) => void; }) { return (
{options.map((o) => { const active = o.value === value; const disabled = !!o.disabled && !active; return ( ); })}
); }