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