import { makeStyles } from '@fluentui/react-components'; import { Flex } from '@fluentui/react-migration-v0-v9'; import type { ArrayFieldItemTemplateProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils'; import { getTemplate, getUiOptions } from '@rjsf/utils'; const useStyles = makeStyles({ arrayFieldItem: { '> .form-group': { width: '100%', }, }, }); /** The `ArrayFieldItemTemplate` component is the template used to render an items of an array. * * @param props - The `ArrayFieldItemTemplateProps` props for the component */ export default function ArrayFieldItemTemplate< T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any, >(props: ArrayFieldItemTemplateProps) { const classes = useStyles(); const { children, buttonsProps, displayLabel, hasToolbar, uiSchema, registry } = props; const uiOptions = getUiOptions(uiSchema); const ArrayFieldItemButtonsTemplate = getTemplate<'ArrayFieldItemButtonsTemplate', T, S, F>( 'ArrayFieldItemButtonsTemplate', registry, uiOptions, ); return ( {children} {hasToolbar && ( )} ); }