import { useTranslations } from "next-intl"; type ErrorMessageProps = { errorMessage: string; }; export const ErrorMessage = ({ errorMessage }: ErrorMessageProps) => { const t = useTranslations(); type TranslationKey = Parameters[0]; return errorMessage !== undefined ? (

{errorMessage.startsWith("FormValidation") ? t(errorMessage as TranslationKey) : errorMessage}

) : null; };