third version before modbus cleanup
This commit is contained in:
@@ -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}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user