mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-04 23:05:13 +01:00
42 lines
1.1 KiB
JavaScript
42 lines
1.1 KiB
JavaScript
import MetricCard from 'components/metrics/MetricCard';
|
|
import useMessages from 'hooks/useMessages';
|
|
import styles from './RealtimeHeader.module.css';
|
|
|
|
export function RealtimeHeader({ data = {} }) {
|
|
const { formatMessage, labels } = useMessages();
|
|
const { pageviews, visitors, events, countries } = data;
|
|
|
|
return (
|
|
<div className={styles.header}>
|
|
<div className={styles.metrics}>
|
|
<MetricCard
|
|
className={styles.card}
|
|
label={formatMessage(labels.views)}
|
|
value={pageviews?.length}
|
|
hideComparison
|
|
/>
|
|
<MetricCard
|
|
className={styles.card}
|
|
label={formatMessage(labels.visitors)}
|
|
value={visitors?.length}
|
|
hideComparison
|
|
/>
|
|
<MetricCard
|
|
className={styles.card}
|
|
label={formatMessage(labels.events)}
|
|
value={events?.length}
|
|
hideComparison
|
|
/>
|
|
<MetricCard
|
|
className={styles.card}
|
|
label={formatMessage(labels.countries)}
|
|
value={countries?.length}
|
|
hideComparison
|
|
/>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default RealtimeHeader;
|