mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-11 20:17:28 +01:00
33 lines
798 B
JavaScript
33 lines
798 B
JavaScript
import MetricsTable from './MetricsTable';
|
|
import { emptyFilter } from 'lib/filters';
|
|
import FilterLink from 'components/common/FilterLink';
|
|
import useLocale from 'hooks/useLocale';
|
|
import useMessages from 'hooks/useMessages';
|
|
|
|
export function CitiesTable({ websiteId, ...props }) {
|
|
const { locale } = useLocale();
|
|
const { formatMessage, labels } = useMessages();
|
|
|
|
function renderLink({ x }) {
|
|
return (
|
|
<div className={locale}>
|
|
<FilterLink id="city" value={x} />
|
|
</div>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<MetricsTable
|
|
{...props}
|
|
title={formatMessage(labels.cities)}
|
|
type="city"
|
|
metric={formatMessage(labels.visitors)}
|
|
websiteId={websiteId}
|
|
dataFilter={emptyFilter}
|
|
renderLabel={renderLink}
|
|
/>
|
|
);
|
|
}
|
|
|
|
export default CitiesTable;
|