M5-T06: add Energy device management UI and sidebar entry

This commit is contained in:
2026-06-22 13:52:33 +02:00
parent 702a1cec00
commit 2dc469274a
11 changed files with 2301 additions and 8 deletions
+8 -4
View File
@@ -1,18 +1,16 @@
/**
* AppSidebar — vertical sidebar navigation for all protected pages.
*
* Nav items: Home / Records / Config
* Nav items: Home / Records / Energy / Config
* Utilities: ColorSchemeToggle + LogoutButton (at bottom)
*
* Current route is highlighted via useLocation().
* Mobile: burger button toggles the navbar open/closed (handled by AppShell context).
*
* NOTE: Energy nav item is intentionally absent — added in M5-T06 once /energy exists.
*/
import { NavLink, Stack, Divider, Tooltip, ActionIcon, useMantineColorScheme, useComputedColorScheme, AppShell, Text, Group } from '@mantine/core'
import { Link, useLocation, useNavigate } from 'react-router-dom'
import { Home, List, Settings, Sun, Moon, LogOut } from 'react-feather'
import { Home, List, Settings, Sun, Moon, LogOut, Zap } from 'react-feather'
import { useQueryClient } from '@tanstack/react-query'
import apiClient from '../api/client'
@@ -40,6 +38,12 @@ const NAV_ENTRIES: NavEntry[] = [
icon: <List size={18} />,
testId: 'nav-records',
},
{
to: '/energy',
label: 'Energy',
icon: <Zap size={18} />,
testId: 'nav-energy',
},
{
to: '/config',
label: 'Config',