import type { HumanName } from "fhir/r4"; import { useAuthServiceContext } from "../../../services"; import { welcomeFirstName, welcomeTitle } from "./homeWelcome.ts"; /** Read from the header's identity so both name the same person; staff are never greeted. */ const HomeWelcome = () => { const { currentUser, USER_ROLES } = useAuthServiceContext(); if (currentUser?.fhir?.resourceType === USER_ROLES.PRACTITIONER) return null; const name = (currentUser?.fhir as { name?: HumanName[] } | undefined)?.name; return

{welcomeTitle(welcomeFirstName(name))}

; }; export default HomeWelcome;