import { ComponentProps, useId } from "react"; import { ControllerFieldState } from "react-hook-form"; import { twJoin } from "tailwind-merge"; interface InputProps extends Omit, "children" | "id"> { label: string; fieldState: ControllerFieldState; } export function Input({ className, label, fieldState, ...props }: InputProps) { const id = useId(); return (
{fieldState.error && ( {fieldState.error.message} )}
); }