umami/components/metrics/EventsTable.js

38 lines
720 B
JavaScript
Raw Normal View History

2020-08-25 08:49:14 +02:00
import React from 'react';
import MetricsTable from './MetricsTable';
import styles from './EventsTable.module.css';
2020-08-28 03:44:20 +02:00
export default function EventsTable({
2020-08-25 08:49:14 +02:00
websiteId,
startDate,
endDate,
limit,
onExpand,
onDataLoad,
}) {
return (
<MetricsTable
title="Events"
type="event"
metric="Actions"
websiteId={websiteId}
startDate={startDate}
endDate={endDate}
limit={limit}
2020-08-28 03:44:20 +02:00
renderLabel={({ x }) => <Label value={x} />}
2020-08-25 08:49:14 +02:00
onExpand={onExpand}
onDataLoad={onDataLoad}
/>
);
}
2020-08-28 03:44:20 +02:00
const Label = ({ value }) => {
const [event, label] = value.split(':');
return (
<>
<span className={styles.type}>{event}</span>
{label}
</>
);
};