import React from 'react' ; import { LabelElement , OwnPropsOfRenderer , RankedTester , rankWith , uiTypeIs , } from '@jsonforms/core' ; import { withJsonFormsLayoutProps } from '@jsonforms/react' ; import { Hidden , Typography } from '@mui/material' ; type { RankedTester } export const materialLabelRendererTester = rankWith ( 1 , uiTypeIs ( 'Label' ) ) ; /**
 * Default renderer for a label.
 */ export const MaterialLabelRenderer = ( { uischema , visible } ) => { const labelElement = uischema as LabelElement ; return ( < Hidden xsUp = { ! visible } > < Typography variant = 'h6' > { labelElement . text !== undefined && labelElement . text !== null && labelElement . text } < /Typography> < /Hidden>); } ; export default withJsonFormsLayoutProps ( MaterialLabelRenderer ) ;