Skip to main content
Glama
ReferenceDisplay.tsx938 B
// SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors // SPDX-License-Identifier: Apache-2.0 import { stringify } from '@medplum/core'; import type { Reference } from '@medplum/fhirtypes'; import type { JSX } from 'react'; import { MedplumLink } from '../MedplumLink/MedplumLink'; export interface ReferenceDisplayProps { readonly value?: Reference; readonly link?: boolean; } export function ReferenceDisplay(props: ReferenceDisplayProps): JSX.Element | null { if (!props.value) { return null; } const displayString = props.value.display || props.value.reference || stringify(props.value); // The "link" prop defaults to "true"; undefined is treated as "true" // To disable the link, it must be explicitly "false" if (props.link !== false && props.value.reference) { return <MedplumLink to={props.value}>{displayString}</MedplumLink>; } else { return <>{displayString}</>; } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/medplum/medplum'

If you have feedback or need assistance with the MCP directory API, please join our Discord server