mirror of
https://github.com/umami-software/umami.git
synced 2026-02-10 07:37:11 +01:00
Updated session profile page. Added TypeIcon component. Added useRegionNames hook.
This commit is contained in:
parent
ac60d08ee5
commit
c3c3b46ef6
313 changed files with 197 additions and 94 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import MetricsTable, { MetricsTableProps } from './MetricsTable';
|
||||
import { emptyFilter } from 'lib/filters';
|
||||
import FilterLink from 'components/common/FilterLink';
|
||||
import TypeIcon from 'components/common/TypeIcon';
|
||||
import { useLocale } from 'components/hooks';
|
||||
import { useMessages } from 'components/hooks';
|
||||
import { useCountryNames } from 'components/hooks';
|
||||
|
|
@ -8,7 +9,7 @@ import { useCountryNames } from 'components/hooks';
|
|||
export function CitiesTable(props: MetricsTableProps) {
|
||||
const { locale } = useLocale();
|
||||
const { formatMessage, labels } = useMessages();
|
||||
const countryNames = useCountryNames(locale);
|
||||
const { countryNames } = useCountryNames(locale);
|
||||
|
||||
const renderLabel = (city: string, country: string) => {
|
||||
const countryName = countryNames[country];
|
||||
|
|
@ -18,12 +19,7 @@ export function CitiesTable(props: MetricsTableProps) {
|
|||
const renderLink = ({ x: city, country }) => {
|
||||
return (
|
||||
<FilterLink id="city" value={city} label={renderLabel(city, country)}>
|
||||
{country && (
|
||||
<img
|
||||
src={`${process.env.basePath || ''}/images/flags/${country?.toLowerCase() || 'xx'}.png`}
|
||||
alt={country}
|
||||
/>
|
||||
)}
|
||||
{country && <TypeIcon type="country" value={country} />}
|
||||
</FilterLink>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue