import * as React from "react" import { cn } from "./utils" interface SegmentedControlProps extends React.ComponentProps<"div"> { segments: string[] activeIndex: number onChange?: (index: number) => void size?: "sm" | "md" } function SegmentedControl({ segments, activeIndex, onChange, size = "md", className, ...props }: SegmentedControlProps) { return (
{segments.map((segment, index) => { const isActive = index === activeIndex return ( ) })}
) } export { SegmentedControl } export type { SegmentedControlProps }