import { useEffect, useState } from "react"; // It uses the useState hook to manage the state of the filtered data, // and an input field with an onKeyUp event listener to trigger the filtering function. // When the function is called, it filters the list of items based on // whether the item's name includes the search query, and updates the state of the filtered data. // The component then renders the list of items or a message indicating that no data was found, // depending on whether there are any items in the filtered data array. const App = () => { const myData = ["Apple", "Banana", "Orange", "Papaya", "Grapes"]; const [filteredData, setFilteredData] = useState(myData); const [query, setQuery] = useState(""); useEffect(() => { const filteredRecords = myData.filter((item) => item.toLowerCase().includes(query.toLowerCase()) ); setFilteredData(filteredRecords); }, [query]); return (