import React from "react"; import { useRouter } from "next/router"; import Link from "next/link"; // components import { ProfileIssuesViewOptions } from "components/profile"; // types import { UserAuth } from "types"; type Props = { memberRole: UserAuth; }; const viewerTabs = [ { route: "", label: "Overview", selected: "/[workspaceSlug]/profile/[userId]", }, ]; const adminTabs = [ { route: "assigned", label: "Assigned", selected: "/[workspaceSlug]/profile/[userId]/assigned", }, { route: "created", label: "Created", selected: "/[workspaceSlug]/profile/[userId]/created", }, { route: "subscribed", label: "Subscribed", selected: "/[workspaceSlug]/profile/[userId]/subscribed", }, ]; export const ProfileNavbar: React.FC = ({ memberRole }) => { const router = useRouter(); const { workspaceSlug, userId } = router.query; const tabsList = memberRole.isOwner || memberRole.isMember || memberRole.isViewer ? [...viewerTabs, ...adminTabs] : viewerTabs; return (
{tabsList.map((tab) => ( {tab.label} ))}
); };