import { cva } from 'class-variance-authority'; import { cn } from '~/lib/utils'; const optionVariants = cva('flex cursor-pointer items-center gap-2 rounded-option font-medium transition-colors', { variants: { size: { sm: 'h-7 px-3 text-xs', md: 'h-[30px] px-3.5 text-sm', }, selected: { true: 'bg-surface-pressed text-text-primary', false: 'text-text-subtle hover:text-text-primary', }, }, }); export interface SegmentedOption { value: Value; label: string; } interface SegmentedControlProps { value: Value; options: readonly SegmentedOption[]; onChange: (value: Value) => void; label?: string; size?: 'sm' | 'md'; surface?: 'raised' | 'sunken'; } export function SegmentedControl({ value, options, onChange, label, size = 'md', surface = 'raised' }: SegmentedControlProps) { return (
{options.map((option) => ( ))}
); }