import {Box, Flex, Text} from '@sanity/ui' import React from 'react' import { BooleanDiff, DiffComponent, DiffTooltip, FromToArrow, useDiffAnnotationColor, } from '../../../diff' import {Checkbox, Switch} from '../preview' export const BooleanFieldDiff: DiffComponent = ({diff, schemaType}) => { const {fromValue, toValue} = diff const {title, options} = schemaType as any const Preview = options?.layout === 'checkbox' ? Checkbox : Switch const userColor = useDiffAnnotationColor(diff, []) || {background: '', text: '', border: ''} const showToValue = toValue !== undefined && toValue !== null return ( {showToValue && ( <> )} {showToValue && title && ( {title} )} ) }