import React , { useCallback } from 'react' ; import { ArrayLayoutProps , isObjectArrayWithNesting , RankedTester , rankWith } from '@jsonforms/core' ; import { Hidden } from '@mui/material' ; import { MaterialArrayLayout } from './MaterialArrayLayout' ; import { withJsonFormsArrayLayoutProps } from '@jsonforms/react' ; export const MaterialArrayLayoutRenderer = ( { visible , enabled , id , uischema , schema , label , rootSchema , renderers , cells , data , path , errors , uischemas , addItem } ) => { const addItemCb = useCallback ( ( p , value ) => addItem ( p , value ) , [ addItem ] ) ; return ( < Hidden xsUp = { ! visible } > < MaterialArrayLayout label = { label } uischema = { uischema } schema = { schema } id = { id } rootSchema = { rootSchema } errors = { errors } enabled = { enabled } visible = { visible } data = { data } path = { path } addItem = { addItemCb } renderers = { renderers } cells = { cells } uischemas = { uischemas } / > < /Hidden>); } ; export const materialArrayLayoutTester = rankWith ( 4 , isObjectArrayWithNesting ) ; export default withJsonFormsArrayLayoutProps ( MaterialArrayLayoutRenderer ) ;