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