import * as React from 'react' import {__, _x} from '@wordpress/i18n' import { useEffect, useState, } from '@wordpress/element' import { Icon, Notice, Spinner, __experimentalVStack as VStack, } from '@wordpress/components' import { applyFilters, } from '@wordpress/hooks' import { useQueryClient, useQuery, } from '@tanstack/react-query' import Fuse from 'fuse.js' import { Search, ButtonGroup, SearchResult, } from '@ska/components' import { QueryClientProvider, fetchIconCollections, fetchIcons, fetchIcon, } from '../../api' import { SKA_ICONS_VER, } from '../../data' import './style.scss' const processSvg = (collection: string, icon: string, svg: string) => { let processedSvg = svg switch(collection) { case 'heroicons': processedSvg = processedSvg .replaceAll('fill="#0F172A"', 'fill="currentColor"') .replaceAll('stroke="#0F172A"', 'stroke="currentColor"') break case 'font-awesome-6': processedSvg = processedSvg.replaceAll('