"use client" import { Input as AriaInput, Label as AriaLabel, TextField, } from "react-aria-components" import { useController, useFormContext } from "react-hook-form" import ErrorMessage from "@/components/TempDesignSystem/Form/ErrorMessage" import Label from "@/components/TempDesignSystem/Form/Label" import Body from "@/components/TempDesignSystem/Text/Body" import styles from "./input.module.css" import type { InputProps } from "./input" export default function Input({ "aria-label": ariaLabel, disabled, label, name, placeholder = "", registerOptions = {}, required = false, type = "text", }: InputProps) { const { control } = useFormContext() const rules = { ...registerOptions, required: "required" in registerOptions ? !!registerOptions.required : required, } const { field, fieldState, formState } = useController({ control, name, rules, }) return ( ) }