1
0
mirror of https://github.com/kremalicious/umami.git synced 2024-12-22 17:23:54 +01:00
umami/components/metrics/EventsTable.js
2020-10-11 02:29:55 -07:00

28 lines
689 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(':');
return (
<>
<Tag>{event}</Tag>
{label}
</>
);
};