/** * Copyright (c) 2023-present Plane Software, Inc. and contributors * SPDX-License-Identifier: AGPL-3.0-only * See the LICENSE file for details. */ import React from "react"; import { observer } from "mobx-react"; import Link from "next/link"; import { useTranslation } from "@plane/i18n"; import { PlaneLockup } from "@plane/propel/icons"; import { PageHead } from "@/components/core/page-title"; import { EAuthModes } from "@/helpers/authentication.helper"; import { useInstance } from "@/hooks/store/use-instance"; const authContentMap = { [EAuthModes.SIGN_IN]: { pageTitle: "Sign up", text: "auth.common.new_to_plane", linkText: "Sign up", linkHref: "/sign-up", }, [EAuthModes.SIGN_UP]: { pageTitle: "Sign in", text: "auth.common.already_have_an_account", linkText: "Sign in", linkHref: "/sign-in", }, }; type AuthHeaderProps = { type: EAuthModes; }; export const AuthHeader = observer(function AuthHeader({ type }: AuthHeaderProps) { const { t } = useTranslation(); // store const { config } = useInstance(); // derived values const enableSignUpConfig = config?.enable_signup ?? false; return ( {t(authContentMap[type].text)} {t(authContentMap[type].linkText)} ) } /> ); }); type TAuthHeaderBase = { pageTitle: string; additionalAction?: React.ReactNode; }; export function AuthHeaderBase(props: TAuthHeaderBase) { const { pageTitle, additionalAction } = props; return ( <>
{additionalAction}
); }