From 0e386dbd7ac1ae3bd7c7412e6eeffa73ba8381ed Mon Sep 17 00:00:00 2001 From: jason Date: Sun, 8 Mar 2026 22:54:36 -0500 Subject: [PATCH] Add BreedingCalendar page --- client/src/pages/BreedingCalendar.jsx | 67 +++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 client/src/pages/BreedingCalendar.jsx diff --git a/client/src/pages/BreedingCalendar.jsx b/client/src/pages/BreedingCalendar.jsx new file mode 100644 index 0000000..17c08bb --- /dev/null +++ b/client/src/pages/BreedingCalendar.jsx @@ -0,0 +1,67 @@ +import { useEffect, useState } from 'react' +import { Heart } from 'lucide-react' +import axios from 'axios' + +function BreedingCalendar() { + const [heatCycles, setHeatCycles] = useState([]) + const [loading, setLoading] = useState(true) + + useEffect(() => { + fetchHeatCycles() + }, []) + + const fetchHeatCycles = async () => { + try { + const res = await axios.get('/api/breeding/heat-cycles/active') + setHeatCycles(res.data) + setLoading(false) + } catch (error) { + console.error('Error fetching heat cycles:', error) + setLoading(false) + } + } + + if (loading) { + return
Loading breeding calendar...
+ } + + return ( +
+

Breeding Calendar

+ +
+

Active Heat Cycles

+ {heatCycles.length === 0 ? ( +
+ +

No active heat cycles

+
+ ) : ( +
+ {heatCycles.map(cycle => ( +
+

{cycle.dog_name}

+

+ Started: {new Date(cycle.start_date).toLocaleDateString()} +

+ {cycle.registration_number && ( +

+ Reg: {cycle.registration_number} +

+ )} +
+ ))} +
+ )} +
+ +
+

Whelping Calculator

+

Calculate expected whelping dates based on breeding dates

+

Feature coming soon...

+
+
+ ) +} + +export default BreedingCalendar \ No newline at end of file