Having trouble finding a way to efficiently search through the CustomersList array. Any help would be greatly appreciated.
Here's what happens after fetching the data:
const data = await res.json();
return {
props: {
CustomersList: data,
}
};
This is how I'm displaying the data on the page:
<ul className="customers">
{CustomersList.map((customer) => (
<form method="POST" action={AppendUrl(customer.Id)}>
<table className="customer-list">
<tr>
<th>Customer Name:</th>
<th>Customer Id:</th>
</tr>
<tr>
<td>{customer.Name}</td>
<td>{customer.Id}</td>
<input type="submit" value="Select"/>
</tr>
</table>
</form>
))}
</ul>
I am interested in adding a search bar that allows users to search for customers by name (customer.Name).