mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 14:17:13 +01:00
New event data screen.
This commit is contained in:
parent
10c438d1de
commit
8ee37d1246
137 changed files with 4918 additions and 321 deletions
5
src/components/common/LoadingPanel.module.css
Normal file
5
src/components/common/LoadingPanel.module.css
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
.panel {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
}
|
||||
36
src/components/common/LoadingPanel.tsx
Normal file
36
src/components/common/LoadingPanel.tsx
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
import { ReactNode } from 'react';
|
||||
import styles from './LoadingPanel.module.css';
|
||||
import classNames from 'classnames';
|
||||
import ErrorMessage from 'components/common/ErrorMessage';
|
||||
import { Loading } from 'react-basics';
|
||||
import Empty from 'components/common/Empty';
|
||||
|
||||
export function LoadingPanel({
|
||||
data,
|
||||
error,
|
||||
isFetched,
|
||||
isLoading,
|
||||
loadingIcon = 'dots',
|
||||
className,
|
||||
children,
|
||||
}: {
|
||||
data?: any;
|
||||
error?: Error;
|
||||
isFetched?: boolean;
|
||||
isLoading?: boolean;
|
||||
loadingIcon?: 'dots' | 'spinner';
|
||||
isEmpty?: boolean;
|
||||
className?: string;
|
||||
children: ReactNode;
|
||||
}) {
|
||||
const isEmpty = !data?.length && !isLoading && isFetched;
|
||||
|
||||
return (
|
||||
<div className={classNames(styles.panel, className)}>
|
||||
{isLoading && !isFetched && <Loading icon={loadingIcon} />}
|
||||
{error && <ErrorMessage />}
|
||||
{!error && isEmpty && <Empty />}
|
||||
{!error && !isEmpty && data && children}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue