mirror of
https://github.com/lucide-icons/lucide.git
synced 2025-12-16 16:57:44 +01:00
* Ignore linting for examples in docs * Formatting JSX single attribute per line * Separte `format` and `lint:format` in package.json * Bump prettier version * Run format
15 lines
386 B
TypeScript
15 lines
386 B
TypeScript
import { IconName, IconNode, Tags } from '../api/fetchIcons';
|
|
import filterIcons from '../helpers/filterIcons';
|
|
|
|
export type Icon = [name: IconName, iconNode: IconNode];
|
|
|
|
function useSearch(icons: Icon[], tags: Tags, query: string) {
|
|
if (!query) return icons;
|
|
|
|
const searchString = query.toLowerCase();
|
|
|
|
return filterIcons(icons, tags, searchString);
|
|
}
|
|
|
|
export default useSearch;
|