mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
Use unknown label for undefined countries
This commit is contained in:
parent
d324305d69
commit
70f919be33
1 changed files with 4 additions and 1 deletions
|
|
@ -28,6 +28,7 @@ export function WorldMap({
|
|||
const { formatMessage, labels } = useMessages();
|
||||
const { countryNames } = useCountryNames(locale);
|
||||
const visitorsLabel = formatMessage(labels.visitors).toLocaleLowerCase(locale);
|
||||
const unknownLabel = formatMessage(labels.unknown);
|
||||
const {
|
||||
dateRange: { startDate, endDate },
|
||||
} = useDateRange(websiteId);
|
||||
|
|
@ -62,7 +63,9 @@ export function WorldMap({
|
|||
if (code === 'AQ') return;
|
||||
const country = metrics?.find(({ x }) => x === code);
|
||||
setTooltipPopup(
|
||||
`${countryNames[code]}: ${formatLongNumber(country?.y || 0)} ${visitorsLabel}` as any,
|
||||
`${countryNames[code] || unknownLabel}: ${formatLongNumber(
|
||||
country?.y || 0,
|
||||
)} ${visitorsLabel}` as any,
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue