refactored types from HistoryChart.tsx
This commit is contained in:
@@ -1,35 +1,16 @@
|
||||
import * as React from "react";
|
||||
import { Box, Typography, ToggleButtonGroup, ToggleButton, Paper } from "@mui/material";
|
||||
|
||||
export interface ChartDataPoint {
|
||||
id: string;
|
||||
amount: number;
|
||||
compareAmount?: number;
|
||||
compareLabel?: string;
|
||||
highlighted?: boolean;
|
||||
}
|
||||
|
||||
export interface ChartSeries {
|
||||
rolling: ChartDataPoint[];
|
||||
calendar: ChartDataPoint[];
|
||||
}
|
||||
|
||||
export interface ChartData {
|
||||
daily: ChartDataPoint[];
|
||||
weekly: ChartSeries;
|
||||
monthly: ChartSeries;
|
||||
}
|
||||
|
||||
export interface HistoryChartProps {
|
||||
header: string;
|
||||
summary?: string;
|
||||
tabs: string[];
|
||||
data: ChartData;
|
||||
period: "rolling" | "calendar";
|
||||
onPeriodChange: (mode: "rolling" | "calendar") => void;
|
||||
comparison: boolean;
|
||||
setComparison: (mode: boolean) => void;
|
||||
}
|
||||
import {
|
||||
Box,
|
||||
Typography,
|
||||
ToggleButtonGroup,
|
||||
ToggleButton,
|
||||
Paper
|
||||
} from "@mui/material";
|
||||
import {
|
||||
ChartDataPoint,
|
||||
HistoryChartProps,
|
||||
ChartData,
|
||||
} from "../types/historyChart";
|
||||
|
||||
const formatDisplay = (
|
||||
point: ChartDataPoint,
|
||||
|
||||
Reference in New Issue
Block a user