rolling and calender toggle

This commit is contained in:
2026-04-06 18:27:05 +05:30
parent 787324260c
commit fc88703a38
3 changed files with 133 additions and 108 deletions

View File

@@ -4,6 +4,7 @@ import { Box, Typography, ToggleButtonGroup, ToggleButton, Paper } from "@mui/ma
export interface ChartDataPoint {
id: string;
amount: number;
compareAmount?: number;
count?: number;
highlighted?: boolean;
}
@@ -34,7 +35,13 @@ export default function HistoryChart({
};
const activeDataKey = activeTab.toLowerCase();
const rawData = data[activeDataKey] || data[activeTab] || [];
let rawData;
if (activeDataKey === "daily") {
rawData = data.daily;
} else {
// @ts-ignore
rawData = data[activeDataKey]?.[period] || [];
}
const currentData = [...rawData].reverse();
const maxAmount =