Merge branch 'dev' into search-formatted-metrics

This commit is contained in:
Mike Cao 2024-11-28 16:36:29 -08:00 committed by GitHub
commit 4ab8b1ff91
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
807 changed files with 45367 additions and 8474 deletions

View file

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