import React from "react"; import { useRouter } from "next/router"; import Link from "next/link"; // hooks import { useUser } from "hooks/store"; // constants import { EUserWorkspaceRoles, WORKSPACE_SETTINGS_LINKS } from "constants/workspace"; export const WorkspaceSettingsSidebar = () => { // router const router = useRouter(); const { workspaceSlug } = router.query; // mobx store const { membership: { currentWorkspaceRole }, } = useUser(); const workspaceMemberInfo = currentWorkspaceRole || EUserWorkspaceRoles.GUEST; return (
SETTINGS
{WORKSPACE_SETTINGS_LINKS.map( (link) => workspaceMemberInfo >= link.access && (
{link.label}
) )}
); };