diff --git a/apps/scandic-web/components/TempDesignSystem/Form/PasswordInput/index.tsx b/apps/scandic-web/components/TempDesignSystem/Form/PasswordInput/index.tsx index 125557a97..c912b9a20 100644 --- a/apps/scandic-web/components/TempDesignSystem/Form/PasswordInput/index.tsx +++ b/apps/scandic-web/components/TempDesignSystem/Form/PasswordInput/index.tsx @@ -12,6 +12,8 @@ import AriaInputWithLabel from "@/components/TempDesignSystem/Form/Input/AriaInp import Caption from "@/components/TempDesignSystem/Text/Caption" import { passwordValidators } from "@/utils/zod/passwordValidator" +import { getErrorMessage } from "../Input/errors" + import styles from "./passwordInput.module.css" import type { PasswordValidatorKey } from "@/types/components/form/newPassword" @@ -109,25 +111,21 @@ export default function PasswordInput({ ) : null} - {isNewPassword && ( + {isNewPassword ? ( - )} + ) : null} {isNewPassword ? ( !field.value && fieldState.error ? ( - {fieldState.error.message} + {getErrorMessage(intl, fieldState.error.message)} ) : null ) : fieldState.error ? ( - {fieldState.error && - intl.formatMessage({ - // eslint-disable-next-line formatjs/enforce-default-message - defaultMessage: fieldState.error.message, - })} + {getErrorMessage(intl, fieldState.error.message)} ) : null}