umami/components/metrics/MetricsBar.js

16 lines
445 B
JavaScript
Raw Normal View History

import { Loading } from 'react-basics';
import ErrorMessage from 'components/common/ErrorMessage';
2023-04-10 05:22:28 +02:00
import styles from './MetricsBar.module.css';
export function MetricsBar({ children, onClick, isLoading, isFetched, error }) {
return (
<div className={styles.bar} onClick={onClick}>
2023-02-04 17:59:52 +01:00
{isLoading && !isFetched && <Loading icon="dots" />}
{error && <ErrorMessage />}
{children}
</div>
);
}
2023-04-21 17:00:42 +02:00
export default MetricsBar;