state controlled by Dashboard.models.ts
This commit is contained in:
@@ -11,9 +11,7 @@ import { configuration } from "./dashboard-config";
|
||||
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, isLoading, error } = useDashboardData(mode);
|
||||
const { data, isLoading, error } = useDashboardData();
|
||||
|
||||
if (isLoading) {
|
||||
return (
|
||||
@@ -39,9 +37,6 @@ export default function Dashboard() {
|
||||
<ConfigurableDashboard
|
||||
config={configuration}
|
||||
data={data}
|
||||
onModeChange={(newMode) => setMode(newMode)}
|
||||
selectedPeriodId={selectedPeriodId}
|
||||
onSelectPeriodId={(newPeriodId) => setSelectedPeriodId(newPeriodId)}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user