import classnames from 'classnames'; import React, { Ref } from 'react'; import { connectField, HTMLFieldProps } from 'uniforms'; import wrapField from './wrapField'; export type BoolFieldProps = HTMLFieldProps< boolean, HTMLDivElement, { inline?: boolean; inputClassName?: string; inputRef?: Ref; labelBefore?: string; } >; function Bool({ onChange, ...props }: BoolFieldProps) { const { disabled, error, inline, inputClassName, inputRef, label, labelBefore, name, readOnly, value, } = props; return wrapField( { ...props, label: labelBefore, value: props.value },
, ); } export default connectField(Bool, { kind: 'leaf' });