Files
khata-ui/src/components/Dashboard/Dashboard.models.ts

51 lines
1.1 KiB
TypeScript

import * as React from "react";
export type DashboardMode = "expense" | "income";
export type DashboardPeriodType = "rolling" | "calendar";
export interface DashboardState {
mode: DashboardMode;
periodType: DashboardPeriodType;
comparison: boolean;
}
export interface DashboardSection {
id: string;
title?: string;
summary?: string;
component: React.ComponentType<any>;
dataKey?: string;
settings?: Record<string, any>;
isList?: boolean;
style?: {
size?: number;
[key: string]: any;
};
}
export interface ColorDefinition {
primary: string;
background?: string;
text?: string;
}
export interface ThemeAwarePalette {
light: ColorDefinition;
dark: ColorDefinition;
}
export interface DashboardConfig {
sections: DashboardSection[];
style?: {
palette?: Record<DashboardMode, ThemeAwarePalette>;
};
}
export interface DashboardProps {
config: DashboardConfig;
data: any; // Aggregated data from features
onModeChange?: (mode: DashboardMode) => void;
selectedPeriodId: string | null;
onSelectPeriodId: (id: string | null) => void;
}