import type { InputHTMLAttributes, ReactNode, TextareaHTMLAttributes } from 'react';
interface BaseProps {
label: string;
htmlFor: string;
error?: string | null;
hint?: string;
required?: boolean;
children: ReactNode;
}
export function FormField({ label, htmlFor, error, hint, required, children }: BaseProps): JSX.Element {
return (
{children}
{error ? (
{error}
) : hint ? (
{hint}
) : null}
);
}
export function TextInput(props: InputHTMLAttributes): JSX.Element {
return ;
}
export function TextArea(props: TextareaHTMLAttributes): JSX.Element {
return (
);
}
interface SelectOption {
value: string;
label: string;
}
interface SelectProps extends Omit, 'children'> {
options: SelectOption[];
}
export function Select({ options, className, ...rest }: SelectProps): JSX.Element {
return (
);
}