diff --git a/frontend/src/pages/DashboardPage.tsx b/frontend/src/pages/DashboardPage.tsx index ddfbf90..ff6ae4b 100644 --- a/frontend/src/pages/DashboardPage.tsx +++ b/frontend/src/pages/DashboardPage.tsx @@ -19,8 +19,25 @@ import { Card } from '../components/ui/card'; import { motion, AnimatePresence } from 'framer-motion'; import { cn } from '../lib/utils'; +// Types +type RoomStatus = 'OK' | 'WARNING' | 'CRITICAL'; +type RoomPhase = 'VEG' | 'FLOWER' | 'DRY' | 'CURE'; +type Trend = 'up' | 'down' | 'stable'; + +interface Room { + id: string; + name: string; + phase: RoomPhase; + status: RoomStatus; + strains: string[]; + metrics: { temp: number; humidity: number; vpd: number; co2: number }; + trend: Trend; + tasks: { due: number; completed: number }; + issue?: string; +} + // Mock Data - separated by status for different display treatments -const MOCK_ROOMS = [ +const MOCK_ROOMS: Room[] = [ { id: '1', name: 'Flower Room A', phase: 'FLOWER', status: 'OK', strains: ['OG Kush', 'Gelato #41'], metrics: { temp: 78.4, humidity: 52, vpd: 1.25, co2: 1200 }, trend: 'stable', tasks: { due: 4, completed: 12 } }, { id: '2', name: 'Flower Room B', phase: 'FLOWER', status: 'WARNING', strains: ['Blue Dream'], metrics: { temp: 82.1, humidity: 68, vpd: 1.10, co2: 1150 }, trend: 'up', tasks: { due: 8, completed: 5 }, issue: 'Humidity climbing' }, { id: '3', name: 'Veg Room 1', phase: 'VEG', status: 'OK', strains: ['Clones - Batch 402'], metrics: { temp: 76.2, humidity: 65, vpd: 0.85, co2: 800 }, trend: 'stable', tasks: { due: 2, completed: 20 } }, @@ -140,7 +157,7 @@ export default function DashboardPage() { } // Attention Card - Only for issues that need action -function AttentionCard({ room, severity }: { room: any, severity: 'critical' | 'warning' }) { +function AttentionCard({ room, severity }: { room: Room, severity: 'critical' | 'warning' }) { const isCritical = severity === 'critical'; return ( @@ -195,8 +212,8 @@ function AttentionCard({ room, severity }: { room: any, severity: 'critical' | ' } // Compact Row for All Systems table -function RoomRow({ room, isExpanded, onToggle }: { room: any, isExpanded: boolean, onToggle: () => void }) { - const statusDot = { +function RoomRow({ room, isExpanded, onToggle }: { room: Room, isExpanded: boolean, onToggle: () => void }) { + const statusDot: Record = { OK: 'bg-[var(--color-primary)]', WARNING: 'bg-[var(--color-warning)]', CRITICAL: 'bg-[var(--color-error)]'