umami/components/metrics/DevicesTable.js
2023-03-09 15:18:54 -08:00

30 lines
714 B
JavaScript

import MetricsTable from './MetricsTable';
import { useIntl } from 'react-intl';
import FilterLink from 'components/common/FilterLink';
import { labels } from 'components/messages';
export default function DevicesTable({ websiteId, ...props }) {
const { formatMessage } = useIntl();
function renderLink({ x: device }) {
return (
<FilterLink
id="device"
value={device}
label={formatMessage(labels[device] || labels.unknown)}
/>
);
}
return (
<MetricsTable
{...props}
title={formatMessage(labels.devices)}
type="device"
metric={formatMessage(labels.visitors)}
websiteId={websiteId}
renderLabel={renderLink}
/>
);
}