umami/components/metrics/BrowsersTable.js
2023-04-07 22:03:52 -07:00

24 lines
689 B
JavaScript

import FilterLink from 'components/common/FilterLink';
import MetricsTable from 'components/metrics/MetricsTable';
import { BROWSERS } from 'lib/constants';
import useMessages from 'hooks/useMessages';
export default function BrowsersTable({ websiteId, ...props }) {
const { formatMessage, labels } = useMessages();
function renderLink({ x: browser }) {
return <FilterLink id="browser" value={browser} label={BROWSERS[browser] || browser} />;
}
return (
<MetricsTable
{...props}
title={formatMessage(labels.browsers)}
type="browser"
metric={formatMessage(labels.visitors)}
websiteId={websiteId}
renderLabel={renderLink}
/>
);
}