2020-09-27 09:51:29 +02:00
|
|
|
import classNames from 'classnames';
|
2020-08-06 04:04:02 +02:00
|
|
|
import styles from './Page.module.css';
|
2022-12-27 01:57:59 +01:00
|
|
|
import { Banner, Loading } from 'react-basics';
|
|
|
|
|
|
|
|
export default function Page({ className, error, loading, children }) {
|
|
|
|
if (error) {
|
|
|
|
return <Banner variant="error">Something went wrong.</Banner>;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (loading) {
|
2023-01-10 08:59:26 +01:00
|
|
|
return <Loading icon="spinner" size="xl" position="page" />;
|
2022-12-27 01:57:59 +01:00
|
|
|
}
|
2020-08-06 04:04:02 +02:00
|
|
|
|
2022-08-23 09:51:37 +02:00
|
|
|
return <div className={classNames(styles.page, className)}>{children}</div>;
|
2020-08-06 04:04:02 +02:00
|
|
|
}
|