import _ from 'lodash' import { useEffect } from 'react' import { useTranslations } from 'next-intl' import { useAppDispatch } from '@/store/hooks' import { InformationCircleIcon } from '@heroicons/react/outline' import Tooltip from '@tw/Tooltip' import { Switch } from '@headlessui/react' import { useKeyPress } from '@hooks/useKeyPress' import { setShowDestinationAddress, setShowSettingsSlideOver, } from '@/slices/bridgeDisplaySlice' import { setDeadlineMinutes, setDestinationAddress, } from '@/slices/bridge/reducer' import { useBridgeDisplayState } from '@/slices/bridge/hooks' const SettingsSlideOver = () => { const dispatch = useAppDispatch() const t = useTranslations('Settings') const { showDestinationAddress } = useBridgeDisplayState() const onClose = () => { dispatch(setShowSettingsSlideOver(false)) } const escPressed = useKeyPress('Escape', true) const escFunc = () => { if (escPressed) { onClose() } } useEffect(escFunc, [escPressed]) return (