Moved events components to events page. Updated map data loading.

This commit is contained in:
Mike Cao 2024-08-08 12:00:38 -07:00
parent c6b8114945
commit f135e4ffbb
8 changed files with 52 additions and 35 deletions

View file

@ -4,21 +4,12 @@ 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 { formatMessage, labels } = useMessages();
const { formatCountry } = useFormat();
const handleDataLoad = (data: any) => {
onDataLoad?.(data);
};
const renderLink = ({ x: code }) => {
return (
<FilterLink
@ -39,7 +30,6 @@ export function CountriesTable({
type="country"
metric={formatMessage(labels.visitors)}
renderLabel={renderLink}
onDataLoad={handleDataLoad}
/>
);
}