import Button from '@mui/material/Button' import Grid from '@mui/material/Grid' import Typography from '@mui/material/Typography' import AppWrapper from 'browser/components/AppWrapper' import renderWhenReady from 'browser/helpers/renderWhenReady' import React from 'react' const Confirm = () => { // @ts-expect-error this exists const dismissConfirmation = () => window.dismissConfirmation() // @ts-expect-error this exists const acceptConfirmation = () => window.acceptConfirmation(); React.useEffect(() => { window.addEventListener('error', (e) => { // @ts-expect-error this exists window.confirmError(e.message) }) window.addEventListener('keypress', (e) => { if (e.key === 'Enter') acceptConfirmation() else if (e.key === 'Escape') dismissConfirmation() }) }, []) return ( ) } renderWhenReady(Confirm)