"use client" import { type ReactNode } from 'react' import { cn } from '@/lib/utils' export interface SegmentedOption { id: T label: string icon?: ReactNode disabled?: boolean accentColor?: string } interface SegmentedControlProps { options: SegmentedOption[] value: T onChange?: (value: T) => void disabled?: boolean className?: string } export function SegmentedControl({ options, value, onChange, disabled = false, className, }: SegmentedControlProps) { return (
{options.map((option, index) => { const isSelected = option.id === value const isDisabled = disabled || option.disabled const accent = option.accentColor ?? '#f9fafb' return ( ) })}
) }