Notes
+ +Aucune note
+ ) : ( + notes.map(note => ( +{note.title}
+ {note.content &&{note.content.substring(0, 150)}...
} + {note.todos && note.todos.length > 0 && ( +diff --git a/client/src/App.tsx b/client/src/App.tsx index 3d7ded3..dc91be6 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -1,35 +1,62 @@ -import { useState } from 'react' -import reactLogo from './assets/react.svg' -import viteLogo from '/vite.svg' -import './App.css' +import { BrowserRouter, Routes, Route, Navigate } from 'react-router-dom'; +import { AuthProvider, useAuth } from './contexts/AuthContext'; +import Login from './pages/Login'; +import Dashboard from './pages/Dashboard'; -function App() { - const [count, setCount] = useState(0) +// Protected Route Component +function ProtectedRoute({ children }: { children: React.ReactNode }) { + const { isAuthenticated } = useAuth(); - return ( - <> -
-
- Edit src/App.tsx and save to test HMR
-
- Click on the Vite and React logos to learn more -
- > - ) + if (!isAuthenticated) { + returnAucune note
+ ) : ( + notes.map(note => ( +{note.content.substring(0, 150)}...
} + {note.todos && note.todos.length > 0 && ( +Connectez-vous pour accéder à vos notes
+Compte par défaut : admin / admin
+