import {Fragment, h, JSX} from 'preact' import {useState, useEffect} from 'preact/hooks' import {useActions, useSelector} from '../../../helpers/connect' import actions from '../../../actions' import assertUnreachable from '../../../helpers/assertUnreachable' const DelayRendering = ({children}) => { const [show, setShow] = useState(false) useEffect(() => { const timeId = setTimeout(() => { setShow(true) }, 10000) return () => { clearTimeout(timeId) } }, []) return {show && children} } const PinkSpinner = ({message, helperText}: {message: string; helperText?: JSX.Element}) => { return (
{message.split('\n').map((line, i) => (

{line}

))}
{helperText &&
{helperText}
}
) } export const WalletOperationStatusType = () => { const {resetWalletOperationStatusType} = useActions(actions) const {walletOperationStatusType} = useSelector((state) => ({ walletOperationStatusType: state.walletOperationStatusType, })) switch (walletOperationStatusType) { case 'txPending': return (

Taking too long? Read why{' '} here .

} /> ) case 'reloading': return case 'txSuccess': return (
Transaction successful!
) case 'txSubmitting': return case 'reloadFailed': return (
Reload failed!
) case 'txFailed': return (
Transaction error
) case null: return (
) default: return assertUnreachable(walletOperationStatusType) } }