import React, { forwardRef, useId } from 'react'; import { cn } from '@/utils/utils'; export interface SelectOption { value: string | number; label: string; } export interface SelectProps extends React.SelectHTMLAttributes { label?: string; error?: string; options: SelectOption[]; placeholder?: string; // Optionnel : ajoute un choix vide par défaut } export const Select = forwardRef( ({ className, label, error, id, options, placeholder, ...props }, ref) => { const autoId = useId(); const selectId = id || autoId; return (
{label && ( )} {error &&

{error}

}
); } ); Select.displayName = "Select";