import type { ReactNode } from "react"; import { cn } from "@/lib/utils"; interface SegmentedControlOption { value: T; label: ReactNode; } interface SegmentedControlProps { value: T; options: Array>; onChange: (value: T) => void; ariaLabel?: string; mode?: "buttons" | "tabs"; className?: string; itemClassName?: string; } export function SegmentedControl({ value, options, onChange, ariaLabel, mode = "buttons", className, itemClassName, }: SegmentedControlProps) { const tabs = mode === "tabs"; return (
{options.map((option) => { const selected = value === option.value; return ( ); })}
); }