import useTranslation from 'next-translate/useTranslation' export interface FormStateProps extends React.ComponentPropsWithRef<'p'> { state: 'success' | 'error' | 'loading' children: string } export const FormState: React.FC = props => { const { state, children, ...rest } = props const { t } = useTranslation() return ( <>

{['error', 'success'].includes(state) && ( {state === 'error' ? t('home:contact.error') : t('home:contact.success')}: )}{' '} {children}

) }