refactor period (rolling/calender) to periodType
This commit is contained in:
@@ -3,7 +3,7 @@ import { ChartDataPoint, HistoryChartProps, ChartData } from "./HistoryChart.mod
|
||||
import HistoryChartView from "./HistoryChart.view";
|
||||
|
||||
export default function HistoryChart(props: HistoryChartProps) {
|
||||
const { tabs, data, period, comparison } = props;
|
||||
const { tabs, data, periodType, comparison } = props;
|
||||
|
||||
const [activeTab, setActiveTab] = React.useState<string>(tabs[0] || "");
|
||||
const [startIndex, setStartIndex] = React.useState(0);
|
||||
@@ -16,7 +16,7 @@ export default function HistoryChart(props: HistoryChartProps) {
|
||||
rawData = data.daily || [];
|
||||
} else {
|
||||
const section = data[activeDataKey];
|
||||
rawData = section?.[period] || [];
|
||||
rawData = section?.[periodType] || [];
|
||||
}
|
||||
|
||||
const currentData = rawData;
|
||||
|
||||
Reference in New Issue
Block a user