import type { ButtonHTMLAttributes, ReactNode } from "react"; import { cn } from "../lib/cn"; type Variant = "primary" | "subtle" | "ghost" | "danger"; type Size = "sm" | "md"; const VARIANTS: Record = { primary: "bg-accent-600 text-white hover:bg-accent-500", subtle: "border border-zinc-700/60 bg-zinc-800/60 text-zinc-300 hover:bg-zinc-700/60", ghost: "text-zinc-400 hover:bg-zinc-800/70 hover:text-zinc-100", danger: "border border-red-500/20 bg-red-500/10 text-red-400 hover:bg-red-500/20", }; const SIZES: Record = { sm: "h-8 px-2.5 text-xs gap-1.5", md: "h-10 px-4 text-sm gap-2", }; interface ButtonProps extends ButtonHTMLAttributes { variant?: Variant; size?: Size; active?: boolean; } export function Button({ variant = "subtle", size = "md", active = false, className, children, ...props }: ButtonProps) { return ( {children} ); } interface SectionProps { title: string; icon?: ReactNode; action?: ReactNode; children: ReactNode; } export function Section({ title, icon, action, children }: SectionProps) { return ( {icon} {title} {action} {children} ); } interface SegmentedOption { value: T; label: string; } interface SegmentedProps { options: SegmentedOption[]; value: T; onChange: (value: T) => void; ariaLabel?: string; } export function Segmented({ options, value, onChange, ariaLabel }: SegmentedProps) { return ( {options.map((opt) => ( onChange(opt.value)} className={cn( "flex-1 rounded-md px-2 py-1.5 text-xs font-medium transition-transform", value === opt.value ? "bg-zinc-700 text-zinc-100 shadow-sm" : "text-zinc-400 hover:text-zinc-100", )} > {opt.label} ))} ); }