import { forwardRef, SelectHTMLAttributes } from 'react'; interface SelectOption { value: string; label: string; disabled?: boolean; } interface SelectProps extends Omit, 'children'> { label?: string; error?: string; options: SelectOption[]; placeholder?: string; } export const Select = forwardRef( ({ className = '', label, error, id, options, placeholder, ...props }, ref) => { const selectId = id || props.name; return ( {label && ( {label} )} {placeholder && ( {placeholder} )} {options.map((option) => ( {option.label} ))} {/* Custom arrow icon */} {error && {error}} ); } ); Select.displayName = 'Select';
{error}