import { Box } from '@mui/material'; import { FieldTemplateProps } from '@rjsf/utils'; import React from 'react'; import { useTranslation } from 'react-i18next'; import { HelpTooltip, StyledErrorText, StyledFieldLabel, StyledFieldWrapper, StyledRequiredIndicator } from '../components'; export const FieldTemplate: React.FC = (props) => { const { id, children, errors, help, schema, hidden, required, displayLabel, label, } = props; const { t } = useTranslation('agent'); if (hidden) { return
{children}
; } const description = schema.description; // Translate the label if it exists const translatedLabel = label ? t(label, label) : undefined; return ( {displayLabel && translatedLabel && ( {translatedLabel} {required && *} {typeof description === 'string' && description && } )} {children} {errors && {errors}} {help} ); };