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