import { useEffect } from 'react' import { BrowserRouter as Router, Routes, Route, Link, useLocation } from 'react-router-dom' import { Home, PawPrint, Activity, Heart, FlaskConical, Settings, ExternalLink, SearchX } from 'lucide-react' import Dashboard from './pages/Dashboard' import DogList from './pages/DogList' import DogDetail from './pages/DogDetail' import PedigreeView from './pages/PedigreeView' import LitterList from './pages/LitterList' import LitterDetail from './pages/LitterDetail' import BreedingCalendar from './pages/BreedingCalendar' import PairingSimulator from './pages/PairingSimulator' import SettingsPage from './pages/SettingsPage' import ExternalDogs from './pages/ExternalDogs' import { useSettings } from './hooks/useSettings' import { ToastProvider, useToast } from './components/Toast' import { ConfirmProvider } from './components/ConfirmDialog' import './App.css' // `match` lets a nav item claim extra path prefixes (e.g. Dogs owns /pedigree/:id) function NavLink({ to, icon: Icon, label, match = [] }) { const location = useLocation() const prefixes = [to, ...match] const isActive = to === '/' ? location.pathname === '/' : prefixes.some(p => location.pathname === p || location.pathname.startsWith(p + '/')) return ( {label} ) } function NotFound() { return (

Page not found

That page doesn't exist or may have been moved.

Back to Dashboard
) } function AppInner() { const { settings, loadError } = useSettings() const toast = useToast() const kennelName = settings?.kennel_name || 'BREEDR' useEffect(() => { if (loadError) toast.error('Failed to load kennel settings — using defaults') }, [loadError, toast]) return (
} /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } />
) } function App() { return ( ) } export default App