import { ArrayFieldTemplateItemType, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils'; import { Box, Flex, Group } from '@mantine/core'; /** The `ArrayFieldItemTemplate` component is the template used to render an items of an array. * * @param props - The `ArrayFieldTemplateItemType` props for the component */ export default function ArrayFieldItemTemplate< T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any >(props: ArrayFieldTemplateItemType) { const { disabled, className, hasCopy, hasMoveDown, hasMoveUp, hasRemove, hasToolbar, index, onCopyIndexClick, onDropIndexClick, onReorderClick, readonly, uiSchema, registry, children, } = props; const { CopyButton, MoveDownButton, MoveUpButton, RemoveButton } = registry.templates.ButtonTemplates; return ( {children} {hasToolbar && ( {(hasMoveUp || hasMoveDown) && ( )} {(hasMoveUp || hasMoveDown) && ( )} {hasCopy && ( )} {hasRemove && ( )} )} ); }