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';
|
2021-02-15 16:31:53 +01:00
|
|
|
|
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();
|
2021-02-15 16:31:53 +01:00
|
|
|
|
2021-02-21 02:27:56 +01:00
|
|
|
function handleDataLoad(data) {
|
2021-02-21 10:31:23 +01:00
|
|
|
props.onDataLoad?.(data);
|
2021-02-21 02:27:56 +01:00
|
|
|
}
|
|
|
|
|
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}
|
|
|
|
onDataLoad={handleDataLoad}
|
|
|
|
/>
|
2020-08-25 08:49:14 +02:00
|
|
|
);
|
|
|
|
}
|