import { Link } from 'react-router-dom'; import style9 from 'style9'; import { getAuth, signOut } from 'firebase/auth'; import { MuiBox as Box } from '@toeverything/components/ui'; import { keyframes } from '@emotion/react'; import { LOGOUT_LOCAL_STORAGE, LOGOUT_COOKIES } from '@toeverything/utils'; const styles = style9.create({ container: { display: 'flex', justifyContent: 'center', alignItems: 'center', width: '100%', height: 'calc( 100vh - 64px )', }, }); type ErrorProps = { title?: string; subTitle?: string; action1Text?: string; action1Route?: string; action2Text?: string; action2Route?: string; clearOnClick?: boolean; }; const floatAnimation = keyframes` 100% { transform: translateY(20px) } `; /** * Exception related pages */ export function Error({ title = 'Page Not Found', subTitle, action1Text, action1Route, action2Text, action2Route, clearOnClick = false, }: ErrorProps) { return (

{title}

{subTitle ?

{subTitle}

: null}
{/* {action1Text ? ( { if (clearOnClick) { event.preventDefault(); LOGOUT_LOCAL_STORAGE.forEach(name => localStorage.removeItem(name) ); document.cookie = LOGOUT_COOKIES.map( name => name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;' ).join(' '); signOut(getAuth()); window.location.href = action1Route || '/login'; } }} > {action1Text} ) : null} */} {/* {action2Text ? ( {action2Text} ) : null} */}
); }