umami/components/metrics/EventsTable.js

29 lines
635 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-31 23:11:30 +02:00
export default function EventsTable({ websiteId, limit, onExpand, onDataLoad }) {
2020-08-25 08:49:14 +02:00
return (
<MetricsTable
title="Events"
type="event"
metric="Actions"
websiteId={websiteId}
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}
</>
);
};