mirror of
https://github.com/umami-software/umami.git
synced 2026-02-10 07:37:11 +01:00
Updated components build.
This commit is contained in:
parent
5f27ba149b
commit
56af91950a
53 changed files with 942 additions and 333 deletions
|
|
@ -1,8 +1,7 @@
|
|||
import { ErrorInfo, ReactNode } from 'react';
|
||||
import { ErrorBoundary as Boundary } from 'react-error-boundary';
|
||||
import { Button } from '@umami/react-zen';
|
||||
import { Button, Column } from '@umami/react-zen';
|
||||
import { useMessages } from '@/components/hooks';
|
||||
import styles from './ErrorBoundary.module.css';
|
||||
|
||||
const logError = (error: Error, info: ErrorInfo) => {
|
||||
// eslint-disable-next-line no-console
|
||||
|
|
@ -14,12 +13,20 @@ export function ErrorBoundary({ children }: { children: ReactNode }) {
|
|||
|
||||
const fallbackRender = ({ error, resetErrorBoundary }) => {
|
||||
return (
|
||||
<div className={styles.error} role="alert">
|
||||
<Column
|
||||
role="alert"
|
||||
gap
|
||||
width="100%"
|
||||
height="100%"
|
||||
position="absolute"
|
||||
justifyContent="center"
|
||||
alignItems="center"
|
||||
>
|
||||
<h1>{formatMessage(messages.error)}</h1>
|
||||
<h3>{error.message}</h3>
|
||||
<pre>{error.stack}</pre>
|
||||
<Button onClick={resetErrorBoundary}>OK</Button>
|
||||
</div>
|
||||
</Column>
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue