import React, { useState } from 'react'; import { Book, AppScreen } from '../types'; interface LibraryProps { books: Book[]; onBookClick: (book: Book) => void; onAddClick: () => void; } export const Library: React.FC = ({ books, onBookClick, onAddClick }) => { const [search, setSearch] = useState(''); const filteredBooks = books.filter(b => b.title.toLowerCase().includes(search.toLowerCase()) || b.author.toLowerCase().includes(search.toLowerCase()) ); return (

Книжная полка

search
setSearch(e.target.value)} />
{filteredBooks.map((book) => (
onBookClick(book)}>
{book.title} {book.status === 'reading' && (
)} {book.status === 'done' && (
DONE
)} {book.isFavorite && (
favorite
)}

{book.title}

{book.author}

))}
); };