import React from 'react'; import * as SelectPrimitive from '@radix-ui/react-select'; import { Check, ChevronDown, ChevronUp } from 'lucide-react'; import { cn } from '../../lib/utils'; import type { UIFont } from '../../infrastructure/config/uiFonts'; interface FontSelectProps { value: string; fonts: UIFont[]; onChange: (value: string) => void; className?: string; disabled?: boolean; } export const FontSelect: React.FC = ({ value, fonts, onChange, className, disabled, }) => { const selectedFont = fonts.find(f => f.id === value); const fitSelectedText = typeof className !== 'string' || !className.includes('w-full'); return ( span]:min-w-0 [&>span]:truncate [&>span]:whitespace-nowrap', fitSelectedText && 'min-w-max', className )} > {selectedFont?.name || value} {fonts.map((font) => ( {font.name} ))} ); }; export default FontSelect;