import { Col, Row, Space } from 'antd'; import { ArrayFieldItemTemplateProps, FormContextType, getUiOptions, getTemplate, RJSFSchema, StrictRJSFSchema, } from '@rjsf/utils'; const BTN_GRP_STYLE = { width: '100%', justifyContent: 'flex-end', }; const BTN_STYLE = { width: 'calc(100% / 4)', }; /** 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 { children, buttonsProps, displayLabel, hasDescription, hasToolbar, index, registry, uiSchema } = props; const uiOptions = getUiOptions(uiSchema); const ArrayFieldItemButtonsTemplate = getTemplate<'ArrayFieldItemButtonsTemplate', T, S, F>( 'ArrayFieldItemButtonsTemplate', registry, uiOptions, ); const { rowGutter = 24, toolbarAlign = displayLabel ? 'middle' : 'top' } = registry.formContext; const margin = hasDescription ? -8 : 16; return ( {children} {hasToolbar && ( )} ); }