period selection

This commit is contained in:
2026-05-01 17:40:54 +05:30
parent 38f7416942
commit 7b0b3fb615
4 changed files with 30 additions and 3 deletions

View File

@@ -12,6 +12,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);
if (isLoading) {
@@ -40,6 +41,8 @@ export default function Dashboard() {
data={data}
latest={latest}
onModeChange={(newMode) => setMode(newMode)}
selectedPeriodId={selectedPeriodId}
onSelectPeriodId={(newPeriodId) => setSelectedPeriodId(newPeriodId)}
/>
);
}