Review React effect search requests

src/search-client.tsTypeScript
@@ -0,0 +1,15 @@
1+export interface SearchResult {
2+ id: string;
3+ label: string;
4+}
5+
6+export async function searchCustomers(
7+ query: string,
8+ signal?: AbortSignal,
9+): Promise<SearchResult[]> {
10+ const response = await fetch(`/api/customers?query=${query}`, { signal });
11+ if (!response.ok) {
12+ throw new Error(`Search failed: ${response.status}`);
13+ }
14+ return (await response.json()) as SearchResult[];
15+}