'use client'; import { type Styling } from '@/components/props'; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'; import { type ILibraryItem } from '../backend/types'; interface SelectLibraryItemProps extends Styling { id?: string; value: ILibraryItem | null; onChange: (newValue: ILibraryItem | null) => void; items?: ILibraryItem[]; placeholder?: string; noBorder?: boolean; } export function SelectLibraryItem({ id, items, value, onChange, placeholder = 'Выберите схему', ...restProps }: SelectLibraryItemProps) { function handleSelect(newValue: string) { const newItem = items?.find(item => item.id === Number(newValue)) ?? null; onChange(newItem); } return ( ); }