From 479a6db6880e4311e0c8bf38ffeaa572be8e69a8 Mon Sep 17 00:00:00 2001 From: Usman Baig Date: Thu, 22 Jan 2026 21:42:39 +0100 Subject: [PATCH] feat(dashboard): update Chart component layout with improved toolbar and export button for enhanced user interaction --- components/dashboard/Chart.tsx | 93 +++++++++++++++++++--------------- 1 file changed, 53 insertions(+), 40 deletions(-) diff --git a/components/dashboard/Chart.tsx b/components/dashboard/Chart.tsx index bb139e1..6331de4 100644 --- a/components/dashboard/Chart.tsx +++ b/components/dashboard/Chart.tsx @@ -15,6 +15,7 @@ import { import type { TooltipProps } from 'recharts' import { formatNumber, formatDuration } from '@/lib/utils/format' import { ArrowTopRightIcon, ArrowBottomRightIcon, DownloadIcon, BarChartIcon } from '@radix-ui/react-icons' +import { Button } from '@/components/ui/Button' const COLORS = { brand: '#FD5E0F', @@ -317,47 +318,59 @@ export default function Chart({ data, prevData, stats, prevStats, interval }: Ch {/* Chart Area */} -
-
- {prevData?.length ? ( - - ) : null} - -
- - {/* Legend when comparing */} - {hasPrev && ( -
- - - This period - - - - Previous period - +
+ {/* Toolbar Row */} +
+ {/* Left side: Legend */} +
+ {hasPrev && ( +
+ + + Current + + + + Previous + +
+ )}
- )} + + {/* Right side: Controls */} +
+ {prevData?.length ? ( + + ) : null} + + {/* Vertical Separator */} +
+ + +
+
{data.length === 0 ? (