refactor period (rolling/calender) to periodType

This commit is contained in:
2026-05-01 17:13:13 +05:30
parent 2d0b0bc470
commit 1daa90d091
2 changed files with 5 additions and 5 deletions

View File

@@ -25,8 +25,8 @@ export interface HistoryChartProps {
summary?: string; summary?: string;
tabs: string[]; tabs: string[];
data: ChartData; data: ChartData;
period: "rolling" | "calendar"; periodType: "rolling" | "calendar";
onPeriodChange: (p: "rolling" | "calendar") => void; onPeriodTypeChange: (p: "rolling" | "calendar") => void;
comparison: boolean; comparison: boolean;
setComparison: (v: boolean) => void; setComparison: (v: boolean) => void;
colorScheme: { colorScheme: {

View File

@@ -33,8 +33,8 @@ export default function HistoryChartView(props: ViewProps) {
header, header,
summary, summary,
tabs, tabs,
period, periodType,
onPeriodChange, onPeriodTypeChange,
comparison, comparison,
setComparison, setComparison,
colorScheme, colorScheme,
@@ -99,7 +99,7 @@ export default function HistoryChartView(props: ViewProps) {
</ToggleButtonGroup> </ToggleButtonGroup>
<Box sx={{ display: "flex", alignItems: "center", justifyContent: "space-between", mb: 3 }}> <Box sx={{ display: "flex", alignItems: "center", justifyContent: "space-between", mb: 3 }}>
<ToggleButtonGroup value={period} exclusive onChange={(_, v) => v && onPeriodChange(v)} size="small"> <ToggleButtonGroup value={periodType} exclusive onChange={(_, v) => v && onPeriodTypeChange(v)} size="small">
<ToggleButton value="rolling">Rolling</ToggleButton> <ToggleButton value="rolling">Rolling</ToggleButton>
<ToggleButton value="calendar" disabled={activeDataKey === "daily"}> <ToggleButton value="calendar" disabled={activeDataKey === "daily"}>
Calendar Calendar