diff --git a/react-project/src/App.jsx b/react-project/src/App.jsx index 48f8a89..1a5e347 100644 --- a/react-project/src/App.jsx +++ b/react-project/src/App.jsx @@ -1,103 +1,63 @@ -import reactLogo from "./assets/react.svg"; -import viteLogo from "./assets/vite.svg"; import Header from "./components/Header"; import Footer from "./components/Footer"; import Carte from "./components/Carte"; -import Compteur from "./components/Compteur"; +import { useState } from "react"; import "./App.css"; +const jeux = [ + { + id: 1, + titre: "Oracle of ages", + console: "Game Boy Color", + annee: 2001, + Type: "2d", + }, + { + id: 2, + titre: "Breath of the Wild", + console: "Switch", + annee: 2017, + Type: "3d", + }, + { id: 3, titre: "Majora's Mask", console: "N64", annee: 2000, Type: "3d" }, + { + id: 4, + titre: "Tears of the kingdom", + console: "Switch", + annee: 2023, + Type: "3d", + }, +]; + function App() { + const [recherche, setRecherche] = useState(""); + + const filtres = jeux.filter((j) => + j.titre.toLowerCase().includes(recherche.toLowerCase()), + ); + return ( <>
- - + setRecherche(e.target.value)} + /> - + {filtres.length === 0 &&

Aucun jeu trouvé 😕

} -
-
- -

Documentation

-

Your questions, answered

- -
-
- -

Connect with us

-

Join the Vite community

- -
-
+ {filtres.map((jeu) => ( + + ))} -