import React, { SelectHTMLAttributes } from 'react'; import { UseFormRegisterReturn, ControllerRenderProps } from 'react-hook-form'; import { formService } from '../../../services/form.service'; export interface AppSelectOption { value: string; label: string; } export interface AppSelectProps extends Omit, 'name'> { label: string; options: AppSelectOption[]; error?: { type: string; message?: string; [key: string]: any } | undefined; register?: UseFormRegisterReturn; // For use with Controller field?: ControllerRenderProps; placeholder?: string; } export function AppSelect({ label, options, error, register, field, placeholder = '', className = '', ...selectProps }: AppSelectProps): JSX.Element { const hasError = !!error; const selectClassName = `w-full ${hasError ? 'border-error' : ''} ${className}`.trim(); return ( ); }