import { signupErrors } from "@/components/Forms/Signup/schema"

import type { IntlShape } from "react-intl"

export function getErrorMessage(intl: IntlShape, errorCode?: string) {
  switch (errorCode) {
    case signupErrors.TERMS_REQUIRED:
      return intl.formatMessage({
        defaultMessage: "You must accept the terms and conditions",
      })
    default:
      console.warn("Error code not supported:", errorCode)
      return errorCode
  }
}
