diff --git a/web/src/controllers/DashboardController/DashboardViewDashboardController/DashboardContentController/DashboardMetricItem/DashboardMetricItem.tsx b/web/src/controllers/DashboardController/DashboardViewDashboardController/DashboardContentController/DashboardMetricItem/DashboardMetricItem.tsx index dbaeed839..5f771a38f 100644 --- a/web/src/controllers/DashboardController/DashboardViewDashboardController/DashboardContentController/DashboardMetricItem/DashboardMetricItem.tsx +++ b/web/src/controllers/DashboardController/DashboardViewDashboardController/DashboardContentController/DashboardMetricItem/DashboardMetricItem.tsx @@ -3,7 +3,7 @@ import { Card, CardHeader } from '@/components/ui/card/CardBase'; import { useDashboardMetric } from './useDashboardMetric'; import { MetricTitle } from './MetricTitle'; import { createBusterRoute, BusterRoutes } from '@/routes'; -import { useMemoizedFn, useMount } from '@/hooks'; +import { useMemoizedFn } from '@/hooks'; import { cn } from '@/lib/classMerge'; import { BusterChart } from '@/components/ui/charts/BusterChart'; @@ -70,6 +70,10 @@ const DashboardMetricItemBase: React.FC<{ setInitialAnimationEnded(metricId); }); + const hideChart = useMemo(() => { + return isDragOverlay && data && data.length > 50; + }, [isDragOverlay, data?.length]); + return ( - {renderChart && chartOptions && ( - - )} + {renderChart && + chartOptions && + (!hideChart ? ( + + ) : ( +
+ ))}
);