mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-16 02:05:04 +01:00
31 lines
826 B
JavaScript
31 lines
826 B
JavaScript
import React from 'react';
|
|
import { FormattedMessage } from 'react-intl';
|
|
import MetricsTable from './MetricsTable';
|
|
import styles from './EventsTable.module.css';
|
|
|
|
export default function EventsTable({ websiteId, token, limit, onExpand, onDataLoad }) {
|
|
return (
|
|
<MetricsTable
|
|
title={<FormattedMessage id="metrics.events" defaultMessage="Events" />}
|
|
type="event"
|
|
metric={<FormattedMessage id="metrics.actions" defaultMessage="Actions" />}
|
|
websiteId={websiteId}
|
|
token={token}
|
|
limit={limit}
|
|
renderLabel={({ x }) => <Label value={x} />}
|
|
onExpand={onExpand}
|
|
onDataLoad={onDataLoad}
|
|
/>
|
|
);
|
|
}
|
|
|
|
const Label = ({ value }) => {
|
|
const [event, label] = value.split(':');
|
|
return (
|
|
<>
|
|
<span className={styles.type}>{event}</span>
|
|
{label}
|
|
</>
|
|
);
|
|
};
|