umami/components/metrics/EventsTable.js

29 lines
751 B
JavaScript
Raw Normal View History

2022-08-05 22:07:20 +02:00
import { defineMessages, useIntl } from 'react-intl';
2020-08-25 08:49:14 +02:00
import MetricsTable from './MetricsTable';
import { eventTypeFilter } from 'lib/filters';
2022-08-05 22:07:20 +02:00
const messages = defineMessages({
events: { id: 'metrics.events', defaultMessage: 'Events' },
actions: { id: 'metrics.actions', defaultMessage: 'Actions' },
});
2020-08-25 08:49:14 +02:00
2020-10-11 11:29:55 +02:00
export default function EventsTable({ websiteId, ...props }) {
2022-08-05 22:07:20 +02:00
const { formatMessage } = useIntl();
function handleDataLoad(data) {
props.onDataLoad?.(data);
}
2020-08-25 08:49:14 +02:00
return (
2022-08-05 22:07:20 +02:00
<MetricsTable
{...props}
title={formatMessage(messages.events)}
type="event"
metric={formatMessage(messages.actions)}
websiteId={websiteId}
dataFilter={eventTypeFilter}
onDataLoad={handleDataLoad}
/>
2020-08-25 08:49:14 +02:00
);
}