import { useEffect, useId, useRef, useState, type KeyboardEvent as ReactKeyboardEvent, } from 'react'; import { ChevronDown, Check, Sparkles, Cpu } from 'lucide-react'; import { cn } from '../utils/cn'; export type ModelBadge = 'pretrained' | 'custom'; export interface ModelOption { id: string; name: string; description?: string; badge?: ModelBadge; } interface Props { /** Currently selected model id */ value: string; /** Fired on selection change */ onChange: (id: string) => void; /** Selectable model definitions */ options: ModelOption[]; /** Optional disabled flag */ disabled?: boolean; /** Optional extra class names for the trigger button */ className?: string; /** Accessible label — defaults to "Model seçici" */ ariaLabel?: string; } const BADGE_LABEL: Record = { pretrained: 'Pre-trained', custom: 'Kendi Modelim', }; const BADGE_STYLE: Record = { // muted blue/gray — pretrained baseline pretrained: 'bg-slate-100 text-slate-700 ring-slate-300', // brand-green — user's own fine-tuned model custom: 'bg-emerald-50 text-emerald-800 ring-emerald-300', }; /** * Header-friendly model selector dropdown. * * - Compact, low-chrome trigger that blends into a header bar. * - Custom popover (not a native