import type { CSSProperties } from 'react'; import type { ArrayFieldItemTemplateProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils'; import { getTemplate, getUiOptions } from '@rjsf/utils'; import Col from 'react-bootstrap/Col'; import Row from 'react-bootstrap/Row'; export default function ArrayFieldItemTemplate< T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any, >(props: ArrayFieldItemTemplateProps) { const { children, buttonsProps, displayLabel, hasDescription, hasToolbar, uiSchema, registry } = props; const uiOptions = getUiOptions(uiSchema); const ArrayFieldItemButtonsTemplate = getTemplate<'ArrayFieldItemButtonsTemplate', T, S, F>( 'ArrayFieldItemButtonsTemplate', registry, uiOptions, ); const btnStyle: CSSProperties = { flex: 1, paddingLeft: 6, paddingRight: 6, fontWeight: 'bold', }; const padding = hasDescription ? 'pb-1' : 'pt-4 mt-2'; return (
{children} {hasToolbar && (
)}
); }