/**
 *
 * @param query
 * @param icons
 */
export function findIcons(query, icons) {
    const MAX_HITS = 20;
    const lowerCaseQuery = query.toLowerCase();
    return icons
        .filter((icon) => {
        return (icon.id.toLowerCase().includes(lowerCaseQuery) ||
            icon.tags.some((tag) => tag.toLowerCase().includes(lowerCaseQuery)));
    })
        .slice(0, MAX_HITS);
}
/**
 *
 * @param icon
 */
export function createListItem(icon) {
    const name = icon.id.replace('.svg', '');
    return {
        text: name,
        icon: name,
        value: name,
    };
}
