@@ -7,6 +7,8 @@ import { formatCurrency } from "@/lib/utils";
77import {
88 ArrowRightLeftIcon ,
99 CalendarIcon ,
10+ ChevronLeftIcon ,
11+ ChevronRightIcon ,
1012 TrendingDownIcon ,
1113 TrendingUpIcon ,
1214} from "lucide-react" ;
@@ -242,20 +244,42 @@ export function MonthlyAnalyticsCard() {
242244 ) ) }
243245 </ div >
244246
245- { /* Dots Indicator */ }
246- < div className = "flex justify-center gap-1" >
247- { dateRanges . map ( ( _ , index ) => (
248- < button
249- key = { index }
250- className = { `h-1.5 w-1.5 rounded-full transition-all duration-200 ${
251- index === currentIndex
252- ? "bg-primary w-4"
253- : "bg-muted-foreground/30 hover:bg-muted-foreground/50"
254- } `}
255- onClick = { ( ) => scrollToIndex ( index ) }
256- aria-label = { `View ${ dateRanges [ index ] . label } analytics` }
257- />
258- ) ) }
247+ { /* Navigation */ }
248+ < div className = "flex items-center justify-center gap-3" >
249+ < button
250+ type = "button"
251+ className = "p-1 rounded-full text-muted-foreground hover:text-foreground disabled:opacity-40"
252+ onClick = { ( ) => scrollToIndex ( Math . max ( 0 , currentIndex - 1 ) ) }
253+ disabled = { currentIndex === 0 }
254+ aria-label = "View previous range"
255+ >
256+ < ChevronLeftIcon className = "h-4 w-4" />
257+ </ button >
258+ < div className = "flex justify-center gap-1" >
259+ { dateRanges . map ( ( _ , index ) => (
260+ < button
261+ key = { index }
262+ className = { `h-1.5 w-1.5 rounded-full transition-all duration-200 ${
263+ index === currentIndex
264+ ? "bg-primary w-4"
265+ : "bg-muted-foreground/30 hover:bg-muted-foreground/50"
266+ } `}
267+ onClick = { ( ) => scrollToIndex ( index ) }
268+ aria-label = { `View ${ dateRanges [ index ] . label } analytics` }
269+ />
270+ ) ) }
271+ </ div >
272+ < button
273+ type = "button"
274+ className = "p-1 rounded-full text-muted-foreground hover:text-foreground disabled:opacity-40"
275+ onClick = { ( ) =>
276+ scrollToIndex ( Math . min ( dateRanges . length - 1 , currentIndex + 1 ) )
277+ }
278+ disabled = { currentIndex === dateRanges . length - 1 }
279+ aria-label = "View next range"
280+ >
281+ < ChevronRightIcon className = "h-4 w-4" />
282+ </ button >
259283 </ div >
260284 </ CardContent >
261285 </ Card >
0 commit comments