import { chakra, Flex } from '@chakra-ui/react'; import React from 'react'; import { Switch } from 'toolkit/chakra/switch'; import { Hint } from 'toolkit/components/Hint/Hint'; interface Props { id: string; onChange: (isChecked: boolean) => void; initialValue?: boolean; isDisabled?: boolean; className?: string; } const UserOpCallDataSwitch = ({ className, initialValue, isDisabled, onChange, id }: Props) => { const [ isChecked, setIsChecked ] = React.useState(initialValue ?? false); const handleChange = React.useCallback(() => { setIsChecked((prevValue) => { const nextValue = !prevValue; onChange(nextValue); return nextValue; }); }, [ onChange ]); return ( Show external call data External call data ); }; export default React.memo(chakra(UserOpCallDataSwitch));