major refactor of the dashboard and react-openapi integration #1
@@ -13,7 +13,7 @@ import { useDashboardData } from "./features/dashboard";
|
||||
export default function Dashboard() {
|
||||
const [mode, setMode] = React.useState<"expense" | "income">("expense");
|
||||
const [selectedPeriodId, setSelectedPeriodId] = React.useState<string | null>(null);
|
||||
const { data, latest, isLoading, error } = useDashboardData(mode);
|
||||
const { data, isLoading, error } = useDashboardData(mode);
|
||||
|
||||
if (isLoading) {
|
||||
return (
|
||||
@@ -39,7 +39,6 @@ export default function Dashboard() {
|
||||
<ConfigurableDashboard
|
||||
config={configuration}
|
||||
data={data}
|
||||
latest={latest}
|
||||
onModeChange={(newMode) => setMode(newMode)}
|
||||
selectedPeriodId={selectedPeriodId}
|
||||
onSelectPeriodId={(newPeriodId) => setSelectedPeriodId(newPeriodId)}
|
||||
|
||||
@@ -44,7 +44,6 @@ export interface DashboardConfig {
|
||||
export interface DashboardProps {
|
||||
config: DashboardConfig;
|
||||
data: any; // Aggregated data from features
|
||||
latest: any[]; // Latest items from features
|
||||
onModeChange?: (mode: DashboardMode) => void;
|
||||
selectedPeriodId: string | null;
|
||||
onSelectPeriodId: (id: string | null) => void;
|
||||
|
||||
Reference in New Issue
Block a user