Skip to main content
Glama
CheckboxFormSection.tsx1.58 kB
// SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors // SPDX-License-Identifier: Apache-2.0 import { Group, Input } from '@mantine/core'; import type { JSX, ReactNode } from 'react'; import { useContext } from 'react'; import { ElementsContext } from '../ElementsInput/ElementsInput.utils'; import classes from '../FormSection/FormSection.module.css'; import { READ_ONLY_TOOLTIP_TEXT, maybeWrapWithTooltip } from '../utils/maybeWrapWithTooltip'; export interface CheckboxFormSectionProps { readonly htmlFor?: string; readonly title?: string; readonly description?: string; readonly withAsterisk?: boolean; readonly children?: ReactNode; readonly testId?: string; readonly fhirPath?: string; readonly readonly?: boolean; } export function CheckboxFormSection(props: CheckboxFormSectionProps): JSX.Element { const { debugMode } = useContext(ElementsContext); let label: ReactNode; if (debugMode && props.fhirPath) { label = `${props.title} - ${props.fhirPath}`; } else { label = props.title; } return maybeWrapWithTooltip( props?.readonly ? READ_ONLY_TOOLTIP_TEXT : undefined, <Group wrap="nowrap" data-testid={props.testId}> <div>{props.children}</div> <div> <Input.Wrapper id={props.htmlFor} label={label} classNames={{ label: props?.readonly ? classes.dimmed : undefined }} description={props.description} withAsterisk={props.withAsterisk} > {(() => null)()} </Input.Wrapper> </div> </Group> ); }

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