import type { ReactNode } from "react"; import { Link } from "react-router-dom"; import { useAuthServiceContext, useStaffPermissionServiceContext } from "../../services"; import { STAFF_WORKSPACES, getWorkspaceLabel, type StaffWorkspace } from "../../utils/staffRoleCatalog.ts"; import { getDefaultDashboardPath } from "../../utils/staffLanding.ts"; import AppSpinner from "../AppSpinner/AppSpinner"; import { useHasStalled } from "../StalledSession/StalledSession"; import AccessNotSettled from "./AccessNotSettled"; /** * Said in place of a patient or practice page that the person's workspace does not include, such as a typed chart * address from HR or Referrals. Nothing of the page mounts. A person who also holds a workspace that includes it is * told to switch; anyone else is told whom to ask. */ const NotInThisWorkspace = ({ workspace, includedIn }: { workspace: string; includedIn?: string }) => { const label = getWorkspaceLabel(workspace as StaffWorkspace); return (
{includedIn ? `Switch to your ${getWorkspaceLabel(includedIn as StaffWorkspace)} workspace to open it.` : "Patient records and the practice’s clinical and front-desk pages aren’t part of your role at this practice. If you need them, ask a practice administrator."}
Go to my {label} workspace