import { Routes, Route, Navigate } from "react-router-dom"; import { useAuth } from "./auth/AuthContext"; import LoginPage from "./auth/LoginPage"; import MainLayout from "./layout/MainLayout"; import MelodyList from "./melodies/MelodyList"; import MelodyDetail from "./melodies/MelodyDetail"; import MelodyForm from "./melodies/MelodyForm"; import MelodySettings from "./melodies/MelodySettings"; import DeviceList from "./devices/DeviceList"; import DeviceDetail from "./devices/DeviceDetail"; import DeviceForm from "./devices/DeviceForm"; function ProtectedRoute({ children }) { const { user, loading } = useAuth(); if (loading) { return (

Loading...

); } if (!user) { return ; } return children; } function DashboardPage() { const { user } = useAuth(); return (

Dashboard

Welcome, {user?.name}. You are logged in as{" "} {user?.role}.

); } export default function App() { return ( } /> } > } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> {/* Phase 4+ routes: } /> } /> */} } /> ); }