diff --git a/frontend/src/components/v2/PageHeader/PageHeader.tsx b/frontend/src/components/v2/PageHeader/PageHeader.tsx index 2284398a4..7c836c525 100644 --- a/frontend/src/components/v2/PageHeader/PageHeader.tsx +++ b/frontend/src/components/v2/PageHeader/PageHeader.tsx @@ -5,29 +5,48 @@ import { ReactNode } from "@tanstack/react-router"; import { twMerge } from "tailwind-merge"; import { Badge } from "@app/components/v2"; +import { BadgeProps } from "@app/components/v2/Badge/Badge"; +import { ProjectType } from "@app/hooks/api/projects/types"; type Props = { title: ReactNode; description?: ReactNode; children?: ReactNode; className?: string; - scope: "org" | "project" | "namespace" | "instance"; + scope: "org" | "namespace" | "instance" | ProjectType; }; const SCOPE_NAME: Record, { label: string; icon: IconDefinition }> = { org: { label: "Organization", icon: faGlobe }, - project: { label: "Project", icon: faCube }, + [ProjectType.SecretManager]: { label: "Secrets Management", icon: faCube }, + [ProjectType.CertificateManager]: { label: "PKI", icon: faCube }, + [ProjectType.SSH]: { label: "SSH", icon: faCube }, + [ProjectType.KMS]: { label: "KMS", icon: faCube }, + [ProjectType.PAM]: { label: "PAM", icon: faCube }, + [ProjectType.SecretScanning]: { label: "Secret Scanning", icon: faCube }, namespace: { label: "Namespace", icon: faCubes }, instance: { label: "Server", icon: faServer } }; +const SCOPE_VARIANT: Record, BadgeProps["variant"]> = { + org: "org", + [ProjectType.SecretManager]: "project", + [ProjectType.CertificateManager]: "project", + [ProjectType.SSH]: "project", + [ProjectType.KMS]: "project", + [ProjectType.PAM]: "project", + [ProjectType.SecretScanning]: "project", + namespace: "namespace", + instance: "instance" +}; + export const PageHeader = ({ title, description, children, className, scope }: Props) => ( -
+

{title}

{scope && ( - + {SCOPE_NAME[scope].label} diff --git a/frontend/src/layouts/AdminLayout/AdminNavBar.tsx b/frontend/src/layouts/AdminLayout/AdminNavBar.tsx index e33cab6ab..49cc1edf9 100644 --- a/frontend/src/layouts/AdminLayout/AdminNavBar.tsx +++ b/frontend/src/layouts/AdminLayout/AdminNavBar.tsx @@ -4,7 +4,6 @@ import { faBuilding, faCog, faDatabase, - faGlobe, faKey, faLock, faPlug, @@ -14,7 +13,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { Link, useMatchRoute } from "@tanstack/react-router"; import { motion } from "framer-motion"; -import { Tab, TabList, Tabs } from "@app/components/v2"; +import { Tab, TabList, Tabs, Tooltip } from "@app/components/v2"; const generalTabs = [ { @@ -74,12 +73,13 @@ export const AdminNavBar = () => {