feat: add Environment Report links to Sidebar and Dashboard
Some checks are pending
Test / backend-test (push) Waiting to run
Test / frontend-test (push) Waiting to run

This commit is contained in:
fullsizemalt 2026-01-06 03:25:22 -08:00
parent dc403c29f5
commit 64d7d56792
2 changed files with 13 additions and 2 deletions

View file

@ -18,6 +18,7 @@ import {
ClipboardList, ClipboardList,
Grid3X3, Grid3X3,
Cloud, Cloud,
Activity,
type LucideIcon type LucideIcon
} from 'lucide-react'; } from 'lucide-react';
@ -116,7 +117,8 @@ export const NAV_SECTIONS: NavSection[] = [
label: 'Analytics', label: 'Analytics',
minRole: 'STAFF', minRole: 'STAFF',
items: [ items: [
{ id: 'reports', label: 'Reports', path: '/reports', icon: BarChart3 }, { id: 'env-report', label: 'Environment Report', path: '/reports/environment', icon: Activity },
{ id: 'reports', label: 'All Reports', path: '/reports', icon: BarChart3 },
{ id: 'financial', label: 'Financial', path: '/financial', icon: DollarSign, minRole: 'MANAGER' }, { id: 'financial', label: 'Financial', path: '/financial', icon: DollarSign, minRole: 'MANAGER' },
{ id: 'insights', label: 'AI Insights', path: '/insights', icon: Brain, minRole: 'MANAGER' }, { id: 'insights', label: 'AI Insights', path: '/insights', icon: Brain, minRole: 'MANAGER' },
] ]

View file

@ -1,7 +1,8 @@
import { useState, useEffect } from 'react'; import { useState, useEffect } from 'react';
import { Link } from 'react-router-dom';
import { import {
Thermometer, Droplets, Wind, Sun, AlertTriangle, Thermometer, Droplets, Wind, Sun, AlertTriangle,
Activity, Settings, RefreshCw, ChevronRight, Wifi, WifiOff, Bell Activity, Settings, RefreshCw, ChevronRight, Wifi, WifiOff, Bell, FileText
} from 'lucide-react'; } from 'lucide-react';
import api from '../lib/api'; import api from '../lib/api';
import { PageHeader, MetricCard, EmptyState, CardSkeleton } from '../components/ui/LinearPrimitives'; import { PageHeader, MetricCard, EmptyState, CardSkeleton } from '../components/ui/LinearPrimitives';
@ -160,6 +161,14 @@ export default function EnvironmentDashboard() {
subtitle="Real-time sensor data and alerts" subtitle="Real-time sensor data and alerts"
actions={ actions={
<div className="flex items-center gap-3"> <div className="flex items-center gap-3">
<Link
to="/reports/environment"
className="hidden sm:flex items-center gap-2 px-3 py-1.5 text-xs font-medium text-[var(--color-text-primary)] bg-[var(--color-bg-tertiary)] hover:bg-[var(--color-bg-secondary)] border border-[var(--color-border-subtle)] rounded-full transition-colors"
>
<FileText size={14} className="text-[var(--color-text-secondary)]" />
Report
</Link>
{/* Live indicator */} {/* Live indicator */}
<div className="flex items-center gap-2 px-3 py-1.5 rounded-full bg-[var(--color-bg-tertiary)]"> <div className="flex items-center gap-2 px-3 py-1.5 rounded-full bg-[var(--color-bg-tertiary)]">
{wsConnected ? ( {wsConnected ? (