import React from "react"; import { FieldProps } from "../../types"; import { getIconForProperty } from "../../util"; import { FieldHelperText, LabelWithIcon } from "../components"; import { BooleanSwitchWithLabel } from "@firecms/ui"; import { useClearRestoreValue } from "../useClearRestoreValue"; type SwitchFieldProps = FieldProps; /** * Simple boolean switch biding to a boolean property. * * This is one of the internal components that get mapped natively inside forms * and tables to the specified properties. * @group Form fields */ export const SwitchFieldBinding = React.forwardRef(function SwitchFieldBinding({ propertyKey, value, setValue, error, showError, autoFocus, disabled, touched, property, includeDescription }: SwitchFieldProps, ref) { useClearRestoreValue({ property, value, setValue }); return ( <> setValue(v)} error={showError} label={} disabled={disabled} autoFocus={autoFocus} size={"medium"} /> ); });