import React from 'react' import type { SwitchProps } from '@toptal/picasso-switch' import { Switch as PicassoSwitch } from '@toptal/picasso-switch' import { FormCompound as PicassoForm } from '@toptal/picasso-form' import type { FieldProps } from '../Field' import PicassoField from '../Field' import type { Props as FieldLabelProps } from '../FieldLabel' export type FormSwitchProps = Omit & { onChange?: SwitchProps['onChange'] value?: string } export type Props = FormSwitchProps & FieldProps & Omit export const Switch = (props: Props) => ( {...props} type='checkbox' label={ props.label ? ( {props.label} ) : null } > {({ // omitting highlight from inputProps // eslint-disable-next-line @typescript-eslint/no-unused-vars highlight, // value is not expected in PicassoSwitch // eslint-disable-next-line @typescript-eslint/no-unused-vars value, ...inputProps }: SwitchProps & { highlight?: 'autofill' value: FormSwitchProps['value'] }) => { return }} ) Switch.displayName = 'Switch' export default Switch