import { Icon, IconType } from '@/components/Icon'; import { IconButton } from '@/components/IconButton'; import { Disclosure, DisclosureButton, DisclosurePanel, } from '@reach/disclosure'; import { FunctionComponent } from 'preact'; import { useState, useRef, useEffect } from 'react'; const DisclosureIconButton: FunctionComponent<{ className?: string; icon: IconType; }> = ({ className = '', icon }) => ( ); /** * AuthAppInfoPopup is an info icon that shows a tooltip when clicked * Tooltip is dismissible by clicking outside * * Note: it can be generalized but more use cases are required * @returns */ export const AuthAppInfoTooltip: FunctionComponent = () => { const [isShown, setShown] = useState(false); const ref = useRef(null); useEffect(() => { const dismiss = () => setShown(false); document.addEventListener('mousedown', dismiss); return () => { document.removeEventListener('mousedown', dismiss); }; }, [ref]); return ( setShown(!isShown)}>
Some apps, like Google Authenticator, do not back up and restore your secret keys if you lose your device or get a new one.
); };