setCards(!data ? [] : dataJson.result.filter(item =>
(item.title.includes(data) || item.author_lastName.includes(data)
|| item.author_firstName.includes(data)))
const [query, setQuery] = React.useState('');
function handleChangeQuery(e) {
setQuery(e.target.value);
}
function handleSubmit(e) {
e.preventDefault();
onValues(query);
}
{
"result": [
{
"_id": "611e5bee6dbecd9b57cd7244",
"author_firstName": "Ангелина",
"author_lastName": "Пастернак",
"title": "Августина и Степан",
"city": "Санкт-Петербург",
"year": 2021
},
{
"_id": "611e5beea040b02068815775",
"author_firstName": "Ангелина",
"author_lastName": "Пастернак",
"title": "Армии племен пустыни",
"city": "Москва",
"year": 2020
}
]
}