import { cn } from '../../utils/classNames'; export interface SegmentedOption { value: T; label: React.ReactNode; } interface SegmentedControlProps { options: SegmentedOption[]; value: T; onChange: (value: T) => void; ariaLabel?: string; className?: string; } /** * A compact segmented (tab-like) control. Extracted from the appearance theme * switch so the same pattern can be reused (e.g. apply modes, filters). */ function SegmentedControl({ options, value, onChange, ariaLabel, className, }: SegmentedControlProps) { return (
{options.map((option) => { const active = option.value === value; return ( ); })}
); } export default SegmentedControl;