import React from 'react' import type { Props as FieldProps } from '../Field' import type { ValueType, IFormComponentProps } from '../FieldBase' import type { Props as FieldLabelProps } from '../FieldLabel' import FieldLabel from '../FieldLabel' import InputField from '../InputField' export type Props< TWrappedComponentProps extends IFormComponentProps, TInputValue > = Omit, 'label'> & Omit const FieldWrapper = < TWrappedComponentProps extends IFormComponentProps, TInputValue extends ValueType = TWrappedComponentProps['value'] >( props: Props ) => { const { label, labelEndAdornment, name, titleCase, children, ...rest } = props return ( {...rest} name={name} label={ label ? ( ) : null } > {children} ) } FieldWrapper.displayName = 'FieldWrapper' export default FieldWrapper