import type { ArrayFieldTitleProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils'; import { getUiOptions, titleId } from '@rjsf/utils'; /** The `ArrayFieldTitleTemplate` component renders a header for the array. * * @param props - The `ArrayFieldTitleProps` for the component */ export default function ArrayFieldTitleTemplate< T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any, >({ title, uiSchema, required, fieldPathId, optionalDataControl }: ArrayFieldTitleProps) { const uiOptions = getUiOptions(uiSchema); let heading = (
{uiOptions.title || title} {required ? '*' : ''}
); if (optionalDataControl) { heading = (
{heading}
{optionalDataControl}
); } return heading; }