refactored HistoryChart to component
This commit is contained in:
37
src/components/HistoryChart/HistoryChart.models.ts
Normal file
37
src/components/HistoryChart/HistoryChart.models.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
export interface _ChartDataPoint {
|
||||
id: string;
|
||||
amount: number;
|
||||
highlighted?: boolean;
|
||||
}
|
||||
|
||||
export interface ChartDataPoint extends _ChartDataPoint {
|
||||
compare?: _ChartDataPoint;
|
||||
}
|
||||
|
||||
export interface ChartData {
|
||||
daily?: ChartDataPoint[];
|
||||
weekly?: Record<string, ChartDataPoint[]>;
|
||||
monthly?: Record<string, ChartDataPoint[]>;
|
||||
}
|
||||
|
||||
export interface AggregatedDashboardData {
|
||||
chartData: ChartData;
|
||||
totalAmount: number;
|
||||
topPayees: Array<{ payeeName: string; amount: number }>;
|
||||
}
|
||||
|
||||
export interface HistoryChartProps {
|
||||
header: string;
|
||||
summary?: string;
|
||||
tabs: string[];
|
||||
data: ChartData;
|
||||
period: "rolling" | "calendar";
|
||||
onPeriodChange: (p: "rolling" | "calendar") => void;
|
||||
comparison: boolean;
|
||||
setComparison: (v: boolean) => void;
|
||||
colorScheme: {
|
||||
primary: string;
|
||||
light: string;
|
||||
text: string;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user