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