import Generic from "cryptocurrency-icons/svg/color/generic.svg"; import type { ComponentProps } from "react"; import { icons } from "./icons"; type OwnProps = { symbol: string; }; type Props = Omit< ComponentProps, keyof OwnProps | "width" | "height" | "viewBox" > & OwnProps; export const PriceFeedIcon = ({ symbol, ...props }: Props) => { const firstPart = symbol.split("/")[0]; const Icon = firstPart && firstPart in icons ? icons[firstPart as keyof typeof icons] : Generic; return ; };