import { useEffect } from 'preact/hooks'; import { useHotkeys } from 'react-hotkeys-hook'; import { api } from '../utils/api'; import states from '../utils/states'; import AccountInfo from './account-info'; function AccountSheet({ account, instance: propInstance, onClose }) { const { masto, instance, authenticated } = api({ instance: propInstance }); const isString = typeof account === 'string'; const escRef = useHotkeys('esc', onClose, [onClose]); useEffect(() => { if (!isString) { states.accounts[`${account.id}@${instance}`] = account; } }, [account]); return (