'use client' import * as React from 'react' import { cn } from '@/lib/utils' export interface SegmentedControlOption { value: T /** Segment label. Pass a fragment for custom trailing content (e.g. a muted count). */ label: React.ReactNode /** Renders the standard count chip after the label when > 0. */ count?: number } interface SegmentedControlProps { value: T onChange: (value: T) => void options: SegmentedControlOption[] 'aria-label'?: string className?: string } /** * The toolbar segmented control (view/mode switcher). Pill-in-pill per the * radius ladder: interactive toolbar controls are pills, and pill nesting is * concentric by construction. One fixed height (h-8) shared with * ToolbarSearch and ContextPicker so a toolbar row reads as one line. */ export function SegmentedControl({ value, onChange, options, className, ...aria }: SegmentedControlProps) { return (
{options.map((opt) => ( // data-ph-unmask: segment labels are static i18n chrome in session // replays; the count chip inside is data and carries data-ph-mask // (nearest tag wins), matching the nav count bubbles. ))}
) }