/** * Copyright (c) 2023-present Plane Software, Inc. and contributors * SPDX-License-Identifier: AGPL-3.0-only * See the LICENSE file for details. */ import Link from "next/link"; // plane packages import type { TAdminAuthErrorInfo } from "@plane/constants"; import { SUPPORT_EMAIL, EAdminAuthErrorCodes } from "@plane/constants"; export enum EErrorAlertType { BANNER_ALERT = "BANNER_ALERT", INLINE_FIRST_NAME = "INLINE_FIRST_NAME", INLINE_EMAIL = "INLINE_EMAIL", INLINE_PASSWORD = "INLINE_PASSWORD", INLINE_EMAIL_CODE = "INLINE_EMAIL_CODE", } const errorCodeMessages: { [key in EAdminAuthErrorCodes]: { title: string; message: (email?: string) => React.ReactNode }; } = { // admin [EAdminAuthErrorCodes.ADMIN_ALREADY_EXIST]: { title: `Admin already exists`, message: () => `Admin already exists. Please try again.`, }, [EAdminAuthErrorCodes.REQUIRED_ADMIN_EMAIL_PASSWORD_FIRST_NAME]: { title: `Email, password and first name required`, message: () => `Email, password and first name required. Please try again.`, }, [EAdminAuthErrorCodes.INVALID_ADMIN_EMAIL]: { title: `Invalid admin email`, message: () => `Invalid admin email. Please try again.`, }, [EAdminAuthErrorCodes.INVALID_ADMIN_PASSWORD]: { title: `Invalid admin password`, message: () => `Invalid admin password. Please try again.`, }, [EAdminAuthErrorCodes.REQUIRED_ADMIN_EMAIL_PASSWORD]: { title: `Email and password required`, message: () => `Email and password required. Please try again.`, }, [EAdminAuthErrorCodes.ADMIN_AUTHENTICATION_FAILED]: { title: `Authentication failed`, message: () => `Authentication failed. Please try again.`, }, [EAdminAuthErrorCodes.ADMIN_USER_ALREADY_EXIST]: { title: `Admin user already exists`, message: () => (