/**
 * 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";
// components
import { AuthBase } from "@/components/auth-screens/auth-base";
import { NodeDCAuthRedirect } from "@/components/auth-screens/nodedc-auth-redirect";
// helpers
import { EAuthModes, EPageTypes } from "@/helpers/authentication.helper";
import { shouldUseNodeDCOIDC } from "@/helpers/nodedc-auth";
// layouts
import DefaultLayout from "@/layouts/default-layout";
// wrappers
import { AuthenticationWrapper } from "@/lib/wrappers/authentication-wrapper";

function HomePage() {
  return (
    <DefaultLayout>
      <AuthenticationWrapper pageType={EPageTypes.NON_AUTHENTICATED}>
        {shouldUseNodeDCOIDC() ? <NodeDCAuthRedirect /> : <AuthBase authType={EAuthModes.SIGN_IN} />}
      </AuthenticationWrapper>
    </DefaultLayout>
  );
}

export default HomePage;
