mirror of
https://github.com/umami-software/umami.git
synced 2026-02-13 09:05:36 +01:00
Merge branch 'dev' into search-formatted-metrics
This commit is contained in:
commit
4ab8b1ff91
807 changed files with 45367 additions and 8474 deletions
|
|
@ -2,34 +2,22 @@ import FilterLink from 'components/common/FilterLink';
|
|||
import { useCountryNames } from 'components/hooks';
|
||||
import { useLocale, useMessages, useFormat } from 'components/hooks';
|
||||
import MetricsTable, { MetricsTableProps } from './MetricsTable';
|
||||
import TypeIcon from 'components/common/TypeIcon';
|
||||
|
||||
export function CountriesTable({
|
||||
onDataLoad,
|
||||
...props
|
||||
}: {
|
||||
onDataLoad: (data: any) => void;
|
||||
} & MetricsTableProps) {
|
||||
export function CountriesTable({ ...props }: MetricsTableProps) {
|
||||
const { locale } = useLocale();
|
||||
const countryNames = useCountryNames(locale);
|
||||
const { countryNames } = useCountryNames(locale);
|
||||
const { formatMessage, labels } = useMessages();
|
||||
const { formatCountry } = useFormat();
|
||||
|
||||
const handleDataLoad = (data: any) => {
|
||||
onDataLoad?.(data);
|
||||
};
|
||||
|
||||
const renderLink = ({ x: code }) => {
|
||||
return (
|
||||
<FilterLink
|
||||
id="country"
|
||||
className={locale}
|
||||
value={countryNames[code] && code}
|
||||
value={(countryNames[code] && code) || code}
|
||||
label={formatCountry(code)}
|
||||
>
|
||||
<img
|
||||
src={`${process.env.basePath}/images/flags/${code?.toLowerCase() || 'xx'}.png`}
|
||||
alt={code}
|
||||
/>
|
||||
<TypeIcon type="country" value={code?.toLowerCase()} />
|
||||
</FilterLink>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue