import React from 'react'; import { MuiOtpInput } from 'mui-one-time-password-input'; import { Controller, useFormContext } from 'react-hook-form'; import FormHelperText from '@mui/material/FormHelperText'; import { IRHFCodesProps } from '../types'; /** * @description {RHFCode} - Renders a component for React Hook Form (RHF) code input. * @param {IRHFCodesProps} props - The props for the component. * @returns {JSX.Element} - The rendered component. */ export const RHFCode = ({ name, ...other }: IRHFCodesProps) => { const { control } = useFormContext(); return ( (
{error && ( {error.message} )}
)} /> ); };