mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-25 02:36:20 +01:00
19 lines
562 B
JavaScript
19 lines
562 B
JavaScript
import classNames from 'classnames';
|
|
import { Banner, Loading } from 'react-basics';
|
|
import useMessages from 'hooks/useMessages';
|
|
import styles from './Page.module.css';
|
|
|
|
export default function Page({ className, error, loading, children }) {
|
|
const { formatMessage, messages } = useMessages();
|
|
|
|
if (error) {
|
|
return <Banner variant="error">{formatMessage(messages.error)}</Banner>;
|
|
}
|
|
|
|
if (loading) {
|
|
return <Loading icon="spinner" size="xl" position="page" />;
|
|
}
|
|
|
|
return <div className={classNames(styles.page, className)}>{children}</div>;
|
|
}
|