import React from "react"; import Link from "next/link"; import { useRouter } from "next/router"; // hooks import { EUserWorkspaceRoles, WORKSPACE_SETTINGS_LINKS } from "@/constants/workspace"; import { useUser } from "@/hooks/store"; // constants 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}
) )}
); };