icns-frontend/components/chain-list/chain-image.tsx
2022-12-15 13:25:07 +09:00

18 lines
374 B
TypeScript

import { useState } from "react";
import Image, { ImageProps } from "next/image";
import KeplrIcon from "../../public/images/svg/keplr-icon.svg";
export const ChainImage = (props: ImageProps) => {
const [src, setSrc] = useState(props.src);
return (
<Image
{...props}
src={src}
sizes="3rem"
onError={() => setSrc(KeplrIcon)}
/>
);
};