mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-15 17:55:08 +01:00
28 lines
689 B
JavaScript
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}
|
|
</>
|
|
);
|
|
};
|