1
0
mirror of https://github.com/kremalicious/umami.git synced 2024-12-24 18:26:20 +01:00
umami/components/metrics/EventsTable.js
2020-12-04 20:45:12 -08:00

28 lines
690 B
JavaScript

import React from 'react';
import { FormattedMessage } from 'react-intl';
import MetricsTable from './MetricsTable';
import Tag from 'components/common/Tag';
export default function EventsTable({ websiteId, ...props }) {
return (
<MetricsTable
{...props}
title={<FormattedMessage id="metrics.events" defaultMessage="Events" />}
type="event"
metric={<FormattedMessage id="metrics.actions" defaultMessage="Actions" />}
websiteId={websiteId}
renderLabel={({ x }) => <Label value={x} />}
/>
);
}
const Label = ({ value }) => {
const [event, label] = value.split('\t');
return (
<>
<Tag>{event}</Tag>
{label}
</>
);
};