From f7a4b32a2c79bf328e0e40ad190411b9b3e10ec8 Mon Sep 17 00:00:00 2001 From: fullsizemalt <106900403+fullsizemalt@users.noreply.github.com> Date: Fri, 19 Dec 2025 20:44:19 -0800 Subject: [PATCH] fix: TypeScript build errors - add missing imports and fix type mismatch - Add cn import to UserMenu.tsx - Add Plus import to RoomDetailPage.tsx - Fix MOCK_ROOMS strains readonly type in DashboardPage.tsx - Refactor RoomsPage.tsx with Control Room aesthetic --- frontend/src/components/layout/UserMenu.tsx | 1 + frontend/src/pages/DashboardPage.tsx | 30 ++- frontend/src/pages/RoomDetailPage.tsx | 2 +- frontend/src/pages/RoomsPage.tsx | 243 +++++++++++++------- 4 files changed, 177 insertions(+), 99 deletions(-) diff --git a/frontend/src/components/layout/UserMenu.tsx b/frontend/src/components/layout/UserMenu.tsx index 0f72e67..ba9d6aa 100644 --- a/frontend/src/components/layout/UserMenu.tsx +++ b/frontend/src/components/layout/UserMenu.tsx @@ -3,6 +3,7 @@ import { Link } from 'react-router-dom'; import { LogOut, ChevronDown, User } from 'lucide-react'; import { useAuth } from '../../context/AuthContext'; import { RoleBadge } from '../ui/RoleBadge'; +import { cn } from '../../lib/utils'; /** * User menu dropdown for desktop sidebar diff --git a/frontend/src/pages/DashboardPage.tsx b/frontend/src/pages/DashboardPage.tsx index f176fd8..352a736 100644 --- a/frontend/src/pages/DashboardPage.tsx +++ b/frontend/src/pages/DashboardPage.tsx @@ -18,16 +18,24 @@ import { Card } from '../components/ui/card'; import { motion } from 'framer-motion'; // Mock Data for Facility Overview -const MOCK_ROOMS = [ - { 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 }, 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 }, tasks: { due: 8, completed: 5 } }, - { 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 }, tasks: { due: 2, completed: 20 } }, - { id: '4', name: 'Veg Room 2', phase: 'VEG', status: 'OK', strains: ['Mothers'], metrics: { temp: 75.8, humidity: 62, vpd: 0.90, co2: 800 }, tasks: { due: 3, completed: 15 } }, - { id: '5', name: 'Drying Room', phase: 'DRY', status: 'OK', strains: ['Harvest 12/15'], metrics: { temp: 62.0, humidity: 60, vpd: 0.75, co2: 400 }, tasks: { due: 1, completed: 30 } }, - { id: '6', name: 'Cure Vault', phase: 'CURE', status: 'OK', strains: ['Bulk - Wedding Cake'], metrics: { temp: 65.4, humidity: 58, vpd: 0.80, co2: 400 }, tasks: { due: 0, completed: 45 } }, - { id: '7', name: 'Flower Room C', phase: 'FLOWER', status: 'CRITICAL', strains: ['Runtz'], metrics: { temp: 88.5, humidity: 72, vpd: 0.95, co2: 1250 }, tasks: { due: 12, completed: 2 } }, - { id: '8', name: 'Flower Room D', phase: 'FLOWER', status: 'OK', strains: ['Sour Diesel'], metrics: { temp: 77.9, humidity: 50, vpd: 1.30, co2: 1200 }, tasks: { due: 5, completed: 10 } }, -] as const; +const MOCK_ROOMS: Array<{ + id: string; + name: string; + phase: 'VEG' | 'FLOWER' | 'DRY' | 'CURE'; + status: 'OK' | 'WARNING' | 'CRITICAL'; + strains: string[]; + metrics: { temp: number; humidity: number; vpd: number; co2: number }; + tasks: { due: number; completed: number }; +}> = [ + { 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 }, 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 }, tasks: { due: 8, completed: 5 } }, + { 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 }, tasks: { due: 2, completed: 20 } }, + { id: '4', name: 'Veg Room 2', phase: 'VEG', status: 'OK', strains: ['Mothers'], metrics: { temp: 75.8, humidity: 62, vpd: 0.90, co2: 800 }, tasks: { due: 3, completed: 15 } }, + { id: '5', name: 'Drying Room', phase: 'DRY', status: 'OK', strains: ['Harvest 12/15'], metrics: { temp: 62.0, humidity: 60, vpd: 0.75, co2: 400 }, tasks: { due: 1, completed: 30 } }, + { id: '6', name: 'Cure Vault', phase: 'CURE', status: 'OK', strains: ['Bulk - Wedding Cake'], metrics: { temp: 65.4, humidity: 58, vpd: 0.80, co2: 400 }, tasks: { due: 0, completed: 45 } }, + { id: '7', name: 'Flower Room C', phase: 'FLOWER', status: 'CRITICAL', strains: ['Runtz'], metrics: { temp: 88.5, humidity: 72, vpd: 0.95, co2: 1250 }, tasks: { due: 12, completed: 2 } }, + { id: '8', name: 'Flower Room D', phase: 'FLOWER', status: 'OK', strains: ['Sour Diesel'], metrics: { temp: 77.9, humidity: 50, vpd: 1.30, co2: 1200 }, tasks: { due: 5, completed: 10 } }, + ]; const MOCK_ALERTS = [ { id: '1', level: 'CRITICAL', source: 'Flower Room C', message: 'Temperature threshold exceeded (>85°F)', time: '5m ago' }, @@ -121,7 +129,7 @@ export default function DashboardPage() {
Total Zones
+{rooms.length}
+Veg Rooms
+{vegCount}
+Flower Rooms
+{flowerCount}
+Active Batches
+{totalBatches}
+No Cultivation Zones Configured
+ {isManager && ( + + )} ++ {room.sqft?.toLocaleString()} sqft • Capacity {room.capacity || '—'} +
+