import * as React from 'react'; import { Button } from '@/components/ui/button'; import { cn } from '@/lib/utils'; export interface SegmentedControlOption { value: T; label: React.ReactNode; } interface SegmentedControlProps { options: SegmentedControlOption[]; value: T; onChange: (value: T) => void; className?: string; size?: 'sm' | 'default'; } export function SegmentedControl({ options, value, onChange, className, size = 'default', }: SegmentedControlProps) { return (
{options.map((option, index) => { const isActive = value === option.value; const isFirst = index === 0; const isLast = index === options.length - 1; return ( ); })}
); }