// ui import { Breadcrumbs, CustomMenu } from "@plane/ui"; import { BreadcrumbLink } from "components/common"; // components import { SidebarHamburgerToggle } from "components/core/sidebar/sidebar-menu-hamburger-toggle"; import { cn } from "helpers/common.helper"; import { FC } from "react"; import { useApplication, useUser } from "hooks/store"; import { ChevronDown, PanelRight } from "lucide-react"; import { observer } from "mobx-react-lite"; import { PROFILE_ADMINS_TAB, PROFILE_VIEWER_TAB } from "constants/profile"; import Link from "next/link"; import { useRouter } from "next/router"; type TUserProfileHeader = { type?: string | undefined } export const UserProfileHeader: FC = observer((props) => { const { type = undefined } = props const router = useRouter(); const { workspaceSlug, userId } = router.query; const AUTHORIZED_ROLES = [20, 15, 10]; const { membership: { currentWorkspaceRole }, } = useUser(); if (!currentWorkspaceRole) return null; const isAuthorized = AUTHORIZED_ROLES.includes(currentWorkspaceRole); const tabsList = isAuthorized ? [...PROFILE_VIEWER_TAB, ...PROFILE_ADMINS_TAB] : PROFILE_VIEWER_TAB; const { theme: themStore } = useApplication(); return (
} />
{type}
} customButtonClassName="flex flex-grow justify-center text-custom-text-200 text-sm" closeOnSelect > <> {tabsList.map((tab) => ( {tab.label} ))}
) });