import { observer } from "mobx-react-lite"; // mobx store import { useMobxStore } from "lib/mobx/store-provider"; // components import { ProfileNavbar, ProfileSidebar } from "components/profile"; type Props = { children: React.ReactNode; className?: string; showProfileIssuesFilter?: boolean; }; const AUTHORIZED_ROLES = [20, 15, 10]; export const ProfileAuthWrapper: React.FC = observer((props) => { const { children, className, showProfileIssuesFilter } = props; const { user: { currentWorkspaceRole }, } = useMobxStore(); if (!currentWorkspaceRole) return null; const isAuthorized = AUTHORIZED_ROLES.includes(currentWorkspaceRole); return (
{isAuthorized ? (
{children}
) : (
You do not have the permission to access this page.
)}
); });