diff --git a/client/src/pages/Dashboard.jsx b/client/src/pages/Dashboard.jsx index b2476fa..6f1da89 100644 --- a/client/src/pages/Dashboard.jsx +++ b/client/src/pages/Dashboard.jsx @@ -1,6 +1,6 @@ import { useEffect, useState } from 'react' import { Link } from 'react-router-dom' -import { Dog, Activity, Heart, AlertCircle } from 'lucide-react' +import { Dog, Activity, Heart, Calendar, Hash, ArrowRight } from 'lucide-react' import axios from 'axios' function Dashboard() { @@ -35,7 +35,7 @@ function Dashboard() { activeHeatCycles: heatCyclesRes.data.length }) - setRecentDogs(dogs.slice(0, 6)) + setRecentDogs(dogs.slice(0, 8)) setLoading(false) } catch (error) { console.error('Error fetching dashboard data:', error) @@ -43,65 +43,203 @@ function Dashboard() { } } + const calculateAge = (birthDate) => { + if (!birthDate) return null + const today = new Date() + const birth = new Date(birthDate) + let years = today.getFullYear() - birth.getFullYear() + let months = today.getMonth() - birth.getMonth() + + if (months < 0) { + years-- + months += 12 + } + + if (years === 0) return `${months}mo` + if (months === 0) return `${years}y` + return `${years}y ${months}mo` + } + if (loading) { return
Total Dogs
-- {stats.males} Males • {stats.females} Females -
+ {/* Stats Grid */} +Total Litters
+Active Heat Cycles
+Start by adding your first dog to the system
- Add Dog +Start building your kennel management system
+ Add Your First Dog{dog.breed} • {dog.sex}
- {dog.registration_number && ( -{dog.registration_number}
- )} + + {/* Info Section */} +