import { FieldRenderProps } from 'react-final-form'; import { Schema } from './types'; import { getLabel } from './utils'; interface LabelProps { className: string; field: FieldRenderProps; schema: Schema; children?: string; } export const Label = ({ className, children, field, schema }: LabelProps) => { const { title } = schema; if (typeof title === 'object') { return ( ); } const label = children || title || getLabel(field.input.name, title); if (!label) return null; if (typeof label === 'object') { return null; } return (