feat(charts): add persistent workspace chart management

This commit is contained in:
litoral05
2026-05-27 14:38:25 +01:00
parent d7ef36fc53
commit ffe3c64cfa
23 changed files with 4407 additions and 202 deletions
+58 -9
View File
@@ -1,25 +1,74 @@
import { useState } from "react";
import { AppShell } from "../components/layout/AppShell";
import { DashboardPage } from "../features/dashboard/pages/DashboardPage";
import { MeteoPage } from "../features/meteo/pages/MeteoPage";
import { ClimateChartsPage } from "../features/climate/pages/ClimateChartsPage";
import { ConsolePage } from "../features/console/pages/ConsolePage";
import { MainChartsPage } from "../features/maincharts/pages/MainChartsPage";
import { SettingsPage } from "../features/settings/pages/SettingsPage";
export type AppPage = "dashboard" | "meteo";
export type AppPage =
| "dashboard"
| "meteo"
| "console"
| "maincharts"
| "settings"
// CLIMATE
| "climate"
| "climateCharts"
| "climateLighting"
| "climateVentilation"
| "climateSynoptic"
// IRRIGATION
| "irrigation"
| "irrigationCharts"
| "irrigationFilters"
| "irrigationConsumption"
| "irrigationDrainage"
| "irrigationSynoptic";
function App() {
const [activePage, setActivePage] = useState<AppPage>("dashboard");
const [activePage, setActivePage] =
useState<AppPage>("dashboard");
return (
<AppShell activePage={activePage} onNavigate={setActivePage}>
{({ theme }) =>
activePage === "meteo" ? (
<MeteoPage theme={theme} />
) : (
<AppShell
activePage={activePage}
onNavigate={setActivePage}
>
{({ theme }) => {
if (activePage === "meteo") {
return <MeteoPage theme={theme} />;
}
if (activePage === "climateCharts") {
return <ClimateChartsPage theme={theme} />;
}
if (activePage === "console") {
return <ConsolePage theme={theme} />;
}
if (activePage === "maincharts") {
return <MainChartsPage theme={theme} />;
}
if (activePage === "settings") {
return <SettingsPage theme={theme} />
}
return (
<DashboardPage
theme={theme}
onOpenMeteo={() => setActivePage("meteo")}
onNavigate={setActivePage}
/>
)
}
);
}}
</AppShell>
);
}