diff --git a/frontend/src/pages/DashboardPage.tsx b/frontend/src/pages/DashboardPage.tsx index 38cb797..511fd6e 100644 --- a/frontend/src/pages/DashboardPage.tsx +++ b/frontend/src/pages/DashboardPage.tsx @@ -1,4 +1,5 @@ import { useState, useEffect } from 'react'; +import { Link } from 'react-router-dom'; import { useAuth } from '../context/AuthContext'; import { useToast } from '../context/ToastContext'; import { Plus, Leaf, ClipboardCheck, AlertTriangle, Activity, Droplet, Salad, Bug, Eye, ArrowRight } from 'lucide-react'; @@ -58,12 +59,12 @@ export default function DashboardPage() { }; const metrics = overview ? [ - { label: 'Active Batches', value: overview.activeBatches.toString(), icon: Leaf, accent: 'accent' }, - { label: 'Total Plants', value: overview.totalPlants.toString(), icon: Leaf, accent: 'success' }, - { label: 'Tasks Completed', value: overview.tasksCompletedThisWeek.toString(), icon: ClipboardCheck, accent: 'accent' }, - { label: 'Tasks Pending', value: overview.tasksPending.toString(), icon: AlertTriangle, accent: 'warning' }, - { label: 'Touch Points', value: overview.touchPointsToday.toString(), icon: Activity, accent: 'accent' }, - { label: 'Rooms', value: overview.totalRooms.toString(), icon: Leaf, accent: 'neutral' }, + { label: 'Active Batches', value: overview.activeBatches.toString(), icon: Leaf, accent: 'accent', link: '/batches' }, + { label: 'Total Plants', value: overview.totalPlants.toString(), icon: Leaf, accent: 'success', link: '/batches' }, + { label: 'Tasks Completed', value: overview.tasksCompletedThisWeek.toString(), icon: ClipboardCheck, accent: 'accent', link: '/tasks' }, + { label: 'Tasks Pending', value: overview.tasksPending.toString(), icon: AlertTriangle, accent: 'warning', link: '/tasks' }, + { label: 'Touch Points', value: overview.touchPointsToday.toString(), icon: Activity, accent: 'accent', link: '/touch-points' }, + { label: 'Rooms', value: overview.totalRooms.toString(), icon: Leaf, accent: 'neutral', link: '/rooms' }, ] : []; const handlePullRefresh = async () => { @@ -114,13 +115,17 @@ export default function DashboardPage() { )) ) : ( metrics.map((m, i) => ( -
-
- +
+
+ +
+

{m.value} @@ -128,7 +133,7 @@ export default function DashboardPage() {

{m.label}

-
+ )) )}