Attempt to mitigate loading all packs on load

- resolve type warnings
- remove unused RegEx
This commit is contained in:
Xevion
2023-02-16 14:35:54 -06:00
parent 9c5627935a
commit b37af0c105
3 changed files with 3 additions and 5 deletions

View File

@@ -1,8 +1,6 @@
import type {FunctionComponent} from "react";
import DisplayIconSingle from "@components/render/DisplayIconSingle";
const regex = /^([A-Z][a-z]{1,})[A-Z]\w+$/;
type Props = {
icons: { id: string, setId: string }[];
};

View File

@@ -23,7 +23,7 @@ const Home: NextPage = () => {
const filtered = useMemo(() => {
const start = new Date();
const results = icons.filter(({id}) => id.toLowerCase().indexOf(query) !== -1);
const results = debouncedQuery.length == 0 ? [] : icons.filter(({id}) => id.toLowerCase().indexOf(query) !== -1);
const end = new Date();
// const results = fuse.search(query, {limit: maximumResults});
@@ -33,7 +33,7 @@ const Home: NextPage = () => {
}, [debouncedQuery]);
const catalog = useMemo(() => {
return <IconCatalog icons={debouncedQuery.length === 0 ? [] : filtered.map(i => i).slice(0, 100)}/>;
return <IconCatalog icons={filtered.map(i => i).slice(0, 100)}/>;
}, [filtered]);
return (

View File

@@ -1,5 +1,5 @@
import codegen from "babel-plugin-codegen/macro";
import {IconType} from "react-icons";
import type {IconType} from "react-icons";
/* eslint-disable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call */
// language=JavaScript