import SingleProject from "../SingleProject/SingleProject.jsx"; import "./Projects.css" import React, {useEffect, useState} from "react"; import {Link, useLocation} from "react-router-dom"; import NavBar from "../NavBar/NavBar.jsx"; function Projects() { const [projects, setProjects] = useState([]); const [error, setError] = useState(null); const location = useLocation(); useEffect(() => { const fetchProjects = async () => { try { const response = await fetch('/api/projects/'); if (!response.ok) { throw new Error(`Erreur HTTP: ${response.status}`); } const data = await response.json(); setProjects(data.data); } catch (err) { setError(err.message); } }; fetchProjects(); }, []); if (error) { return
Here you can find a collection of my work.