third version before modbus cleanup

This commit is contained in:
Dusan Vojacek
2026-04-03 16:03:06 +02:00
parent 9f4126946d
commit 182d5a37e1
18 changed files with 846 additions and 128 deletions

View File

@@ -1,6 +1,7 @@
import type { ChartArea } from 'chart.js'
import { Activity, Battery, ChevronDown, ChevronUp, Sun, Zap } from 'lucide-react'
import { memo, useCallback, useEffect, useState } from 'react'
import { useNavigate } from 'react-router-dom'
import { EnergyChart } from '../components/charts/EnergyChart'
import { ForecastPanel } from '../components/charts/ForecastPanel'
@@ -57,6 +58,7 @@ function MetricSkeleton() {
}
export function Dashboard() {
const navigate = useNavigate()
const { site: siteRow, ready: siteReady, error: siteErr } = useSiteStatus()
const siteId = siteRow?.site_id ?? null
const data = useDashboardData(siteId)
@@ -172,7 +174,7 @@ export function Dashboard() {
activatedAt={modeActivatedAt}
nextReplanIn={nextReplanIn}
onReplan={handleReplan}
onModeChange={() => {}}
onModeChange={() => navigate('/settings')}
/>
) : null}

View File

@@ -6,4 +6,6 @@ declare module 'react-router-dom' {
export function Route(props: Record<string, unknown>): JSX.Element | null
export function Outlet(): JSX.Element | null
export function NavLink(props: Record<string, unknown>): JSX.Element
/** Zjednodušená deklarace celý modul je zde ručně kvůli buildu bez @types balíčku. */
export function useNavigate(): (to: string) => void
}