Updated session profile page. Added TypeIcon component. Added useRegionNames hook.

This commit is contained in:
Mike Cao 2024-07-29 01:38:36 -07:00
parent ac60d08ee5
commit c3c3b46ef6
313 changed files with 197 additions and 94 deletions

View file

@ -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>
);
};