Skip to content

Commit 7d703c0

Browse files
committed
fix: slightly better performance, lazy loaded CE section
1 parent 55497d5 commit 7d703c0

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

apps/dashboard/app/(main)/websites/[id]/_components/tabs/overview-tab.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ import dayjs from 'dayjs';
1313
import timezone from 'dayjs/plugin/timezone';
1414
import utc from 'dayjs/plugin/utc';
1515
import { useAtom } from 'jotai';
16-
17-
import { useCallback, useMemo } from 'react';
16+
import { lazy, useCallback, useMemo } from 'react';
1817
import {
1918
DataTable,
2019
DeviceTypeCell,
@@ -28,11 +27,9 @@ import {
2827
type ReferrerSourceCellData,
2928
} from '@/components/atomic/ReferrerSourceCell';
3029
import { MetricsChart } from '@/components/charts/metrics-chart';
31-
3230
import { useBatchDynamicQuery } from '@/hooks/use-dynamic-query';
3331
import { useTableTabs } from '@/lib/table-tabs';
3432
import { getUserTimezone } from '@/lib/timezone';
35-
3633
import {
3734
metricVisibilityAtom,
3835
toggleMetricAtom,
@@ -50,7 +47,12 @@ import {
5047
} from '../utils/technology-helpers';
5148
import type { FullTabProps, MetricPoint } from '../utils/types';
5249
import { MetricToggles } from '../utils/ui-components';
53-
import { CustomEventsSection } from './sections/custom-events-section';
50+
51+
const CustomEventsSection = lazy(() =>
52+
import('./sections/custom-events-section').then((mod) => ({
53+
default: mod.CustomEventsSection,
54+
}))
55+
);
5456

5557
interface ChartDataPoint {
5658
date: string;

0 commit comments

Comments
 (0)