Skip to main content
Glama
AllClinicsPage.tsx1.97 kB
// SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors // SPDX-License-Identifier: Apache-2.0 import { Alert, Text, Title } from '@mantine/core'; import { Document, SearchControl, useMedplumNavigate } from '@medplum/react'; import { IconAlertCircle } from '@tabler/icons-react'; import type { JSX } from 'react'; import { Outlet } from 'react-router'; import { useAdminStatus } from '../utils/admin'; /** * A page component that displays a searchable list of all clinics in the system. * Shows clinics accessible to the current user in the current project context. * Provides search functionality and navigation to individual clinic details. * * @returns The clinics listing page */ export function ClinicPage(): JSX.Element { const { isAdmin, loading: adminLoading } = useAdminStatus(); const navigate = useMedplumNavigate(); // If still checking admin status, show loading if (adminLoading) { return ( <Document> <Title>Manage Clinics</Title> <Text>Loading...</Text> </Document> ); } // If user is not an admin, show access denied message if (!isAdmin) { return ( <Document> <Title>Manage Clinics</Title> <Alert icon={<IconAlertCircle size={16} />} title="Access Denied" color="red"> You need to be an Admin to view this page. Please contact your system administrator for access. </Alert> </Document> ); } return ( <Document> <Title>Manage Clinics</Title> <Text>Select a clinic to manage</Text> <SearchControl search={{ resourceType: 'Organization', fields: ['name', '_lastUpdated'], sortRules: [ { code: 'name', descending: false, }, ], }} onClick={(e) => navigate(`/Organization/${e.resource.id}/manage`)} hideToolbar={true} /> <Outlet /> </Document> ); }

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