import React from "react"; import bs58 from "bs58"; import { useHistory, useLocation } from "react-router-dom"; import Select, { InputActionMeta, ActionMeta, ValueType } from "react-select"; import StateManager from "react-select"; import { LOADER_IDS, PROGRAM_IDS, SYSVAR_IDS, ProgramName, LoaderName, } from "utils/tx"; import { TokenRegistry } from "tokenRegistry"; import { Cluster, useCluster } from "providers/cluster"; export function SearchBar() { const [search, setSearch] = React.useState(""); const selectRef = React.useRef | null>(null); const history = useHistory(); const location = useLocation(); const { cluster } = useCluster(); const onChange = ({ pathname }: ValueType, meta: ActionMeta) => { if (meta.action === "select-option") { history.push({ ...location, pathname }); setSearch(""); } }; const onInputChange = (value: string, { action }: InputActionMeta) => { if (action === "input-change") setSearch(value); }; const resetValue = "" as any; return (