Skip to main content
Glama
ResourceDetailPage.tsx930 B
// SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors // SPDX-License-Identifier: Apache-2.0 import { Stack, Title } from '@mantine/core'; import { getDisplayString } from '@medplum/core'; import { ResourceTable, useResource } from '@medplum/react'; import type { JSX } from 'react'; import { useParams } from 'react-router'; /** * This is an example of a generic "Resource Display" page. * It uses the Medplum `<ResourceTable>` component to display a resource. * @returns A React component that displays a resource. */ export function ResourceDetailPage(): JSX.Element | null { const { resourceType, id } = useParams(); const resource = useResource({ reference: resourceType + '/' + id }); if (!resource) { return null; } return ( <Stack> <Title>{getDisplayString(resource)}</Title> <ResourceTable key={`${resourceType}/${id}`} value={resource} /> </Stack> ); }

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