import { useState } from "react"; import { Input } from "@/components/ui/input"; import { Button } from "@/components/ui/button"; import { Card, CardContent } from "@/components/ui/card"; export default function TheOnlyBookstore() { const [books, setBooks] = useState([ { title: "Virgil Abloh: Figures of Speech", author: "Michael Darling", genre: "Art, Mode", publisher: "The Museum of Contemporary Art Chicago et DelMonico Books", year: 2019, image: "https://delmonicobooks.com/wp-content/uploads/2022/02/Abloh_Cover-768x966.jpg" }, { title: "Nadia Lee Cohen: Women", author: "Nadia Lee Cohen", genre: "Photographie, Art", publisher: "Idea Books", year: 2020, image: "https://www.ideanow.online/wp-content/uploads/2020/11/Women5_Cover-768x1024.jpg" }, { title: "Petra Collins: Coming of Age", author: "Petra Collins", genre: "Photographie, Art", publisher: "Rizzoli", year: 2018, image: "https://www.aladin.co.kr/shop/wproduct/9780847863484_1.jpg" }, { title: "Tim Walker: Wonderful Things", author: "Tim Walker", genre: "Photographie, Mode", publisher: "V&A Publishing", year: 2019, image: "https://www.vam.ac.uk/__data/assets/image/0011/175650/Tim_Walker_book_cover.jpg" }, { title: "Hugo Comte", author: "Hugo Comte", genre: "Photographie, Mode", publisher: "Nikita Ltd.", year: 2021, image: "https://models.com/work/book-hugo-comte-book/hugo-comte-book-01.jpg" }, { title: "Tyler Mitchell: I Can Make You Feel Good", author: "Tyler Mitchell", genre: "Photographie, Culture", publisher: "Prestel Publishing", year: 2020, image: "https://gagosianshop.com/wp-content/uploads/2020/07/Tyler_Mitchell_I_Can_Make_You_Feel_Good_01-768x1024.jpg" }, { title: "Helmut Newton: Magnifier le désastre", author: "Jean-Pierre Luminet", genre: "Photographie, Biographie", publisher: "Du Regard", year: 2019, image: "https://pictures.abebooks.com/inventory/md/md30707188523.jpg" } ]); const [newBook, setNewBook] = useState({ title: "", author: "", genre: "", publisher: "", year: "", image: "" }); const [searchTerm, setSearchTerm] = useState(""); const addBook = () => { if (newBook.title && newBook.author && newBook.genre) { setBooks([...books, newBook]); setNewBook({ title: "", author: "", genre: "", publisher: "", year: "", image: "" }); } }; const filteredBooks = books.filter(book => book.title.toLowerCase().includes(searchTerm.toLowerCase()) || book.author.toLowerCase().includes(searchTerm.toLowerCase()) || book.genre.toLowerCase().includes(searchTerm.toLowerCase()) || book.publisher.toLowerCase().includes(searchTerm.toLowerCase()) || book.year.toString().includes(searchTerm) ); return (
{book.author} - {book.genre}
{book.publisher}, {book.year}