import { Box, Typography } from '@mui/material'; import { ArrayFieldTemplateProps } from '@rjsf/utils'; import React from 'react'; import { useTranslation } from 'react-i18next'; import { ArrayAddButton, ArrayContainer, ArrayHeader, ArrayItemCount, EmptyState, HelpTooltip, StyledFieldLabel } from '../components'; /** * Enhanced Array Field Template * In RJSF 6.x, items are pre-rendered ReactElements, so we just display them * The drag-and-drop and collapse logic is handled in ArrayFieldItemTemplate */ export const ArrayFieldTemplate: React.FC = (props) => { const { items, onAddClick, canAdd, title, schema } = props; const { t } = useTranslation('agent'); const description = schema.description; return ( {title && ( {t(title)} {typeof description === 'string' && description && } {items.length > 0 && {t('PromptConfig.ItemCount', { count: items.length })}} )} {canAdd && items.length > 0 && ( )} {items.length === 0 ? ( {t('PromptConfig.EmptyArray')} ) : ( {items} )} {canAdd && ( )} ); };