Skip to content
This repository was archived by the owner on Nov 28, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 18 additions & 8 deletions components/LazerPriceIdTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,22 +69,32 @@ const LoadedLazerPriceIdTable = ({
}, []);

const filteredFeeds = useMemo(() => {
const searchTerms = search
.split(/[,\s]+/)
.map((term) => term.trim().toLowerCase())
.filter((term) => term.length > 0);

if (searchTerms.length === 0) {
return priceFeeds;
}

return priceFeeds.filter((feed) => {
const searchLower = search.toLowerCase();
return (
feed.symbol.toLowerCase().includes(searchLower) ||
feed.name.toLowerCase().includes(searchLower) ||
feed.description.toLowerCase().includes(searchLower) ||
feed.pyth_lazer_id.toString().includes(searchLower)
);
return searchTerms.some((searchTerm) => {
return (
feed.symbol.toLowerCase().includes(searchTerm) ||
feed.name.toLowerCase().includes(searchTerm) ||
feed.description.toLowerCase().includes(searchTerm) ||
feed.pyth_lazer_id.toString().includes(searchTerm)
);
});
});
}, [priceFeeds, search]);

return (
<div>
<input
type="text"
placeholder="Search by symbol, name, description, or pyth lazer id..."
placeholder="Search by symbol, name, description, or pyth lazer id (comma or space separated for multiple)..."
value={search}
onChange={updateSearch}
className="w-full p-2 mb-4 border border-gray-300 rounded-md"
Expand Down
Loading