import { Pressable, View } from "react-native"; import { Text } from "./Text"; /** * SegmentedControl — a row of equal-width options where the selected one is * highlighted with the accent (matches the web font-size / theme pickers). */ export function SegmentedControl({ options, value, onChange, className, }: { options: { id: T; label: string }[]; value: T; onChange: (id: T) => void; className?: string; }) { return ( {options.map((opt) => { const active = opt.id === value; return ( onChange(opt.id)} className={`flex-1 items-center border py-2 ${active ? "border-accent-brand/40 bg-accent-brand/10" : "border-border active:bg-muted/40"}`} > {opt.label} ); })} ); }