// REFACTOR(akhilmhdh): This file needs to be split into multiple components too complex import { useState } from "react"; import { Helmet } from "react-helmet"; import { useTranslation } from "react-i18next"; import { faExclamationCircle } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal"; import { NewProjectModal } from "@app/components/projects"; import { PageHeader } from "@app/components/v2"; import { useSubscription } from "@app/context"; import { useFetchServerStatus } from "@app/hooks/api/serverDetails"; import { ProjectType } from "@app/hooks/api/workspace/types"; import { usePopUp } from "@app/hooks/usePopUp"; import { AllProjectView } from "./components/AllProjectView"; import { MyProjectView } from "./components/MyProjectView"; import { ProjectListToggle, ProjectListView } from "./components/ProjectListToggle"; const formatDescription = (type: ProjectType) => { if (type === ProjectType.SecretManager) return "Securely store, manage, and rotate various application secrets, such as database credentials, API keys, etc."; if (type === ProjectType.CertificateManager) return "Manage your PKI infrastructure and issue digital certificates for services, applications, and devices."; if (type === ProjectType.KMS) return "Centralize the management of keys for cryptographic operations, such as encryption and decryption."; if (type === ProjectType.SecretScanning) return "Connect and monitor data sources to prevent secret leaks."; return "Infisical SSH lets you issue SSH credentials to users for short-lived, secure SSH access to infrastructure."; }; type Props = { type: ProjectType; }; // #TODO: Update all the workspaceIds export const ProductOverviewPage = ({ type }: Props) => { const { t } = useTranslation(); const [projectListView, setProjectListView] = useState(ProjectListView.MyProjects); const { popUp, handlePopUpOpen, handlePopUpToggle } = usePopUp([ "addNewWs", "upgradePlan" ] as const); const { data: serverDetails } = useFetchServerStatus(); const { subscription } = useSubscription(); const isAddingProjectsAllowed = subscription?.workspaceLimit ? subscription.workspacesUsed < subscription.workspaceLimit : true; return (
Announcements