2023-04-14 07:28:29 +02:00
|
|
|
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';
|
|
|
|
|
2023-04-21 17:00:42 +02:00
|
|
|
export function CitiesTable({ websiteId, ...props }) {
|
2023-04-14 07:28:29 +02:00
|
|
|
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}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
}
|
2023-04-21 17:00:42 +02:00
|
|
|
|
|
|
|
export default CitiesTable;
|