11import React from 'react'
2- import Image from 'next/ image'
2+ import { FallbackImage } from '@/components/fallback- image'
33import { IoIosArrowUp , IoIosArrowDown } from 'react-icons/io'
44
55import { NetworkBoxProps } from './network-box.types'
@@ -25,17 +25,13 @@ export const NetworkBox = ({ type, selected, isOpen, networks, onToggle, onSelec
2525 < div className = "relative" >
2626 < div className = "flex items-center gap-3 p-2 px-4 bg-white rounded-xl border border-gray-200 min-h-[90px] max-h-[90px]" >
2727 < div className = "w-[38px] h-[38px] relative rounded-full overflow-hidden ml-3" >
28- < Image
28+ < FallbackImage
2929 src = { selected . icon }
3030 fill
3131 alt = { selected . name }
3232 sizes = "38px"
3333 className = "object-cover rounded-full"
34- onError = { ( e ) => {
35- ; ( e . target as HTMLImageElement ) . srcset = ''
36- ; ( e . target as HTMLImageElement ) . src =
37- 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="38" height="38" viewBox="0 0 38 38"%3E%3Ccircle cx="19" cy="19" r="19" fill="%23ccc"%3E%3C/circle%3E%3Ctext x="19" y="25" font-family="Arial" font-size="20" fill="%23fff" text-anchor="middle"%3E%3F%3C/text%3E%3C/svg%3E'
38- } }
34+ fallbackSvg = 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="38" height="38" viewBox="0 0 38 38"%3E%3Ccircle cx="19" cy="19" r="19" fill="%23ccc"%3E%3C/circle%3E%3Ctext x="19" y="25" font-family="Arial" font-size="20" fill="%23fff" text-anchor="middle"%3E%3F%3C/text%3E%3C/svg%3E'
3935 />
4036 </ div >
4137 < div className = "flex flex-col text-xs text-gray-500 font-medium" >
@@ -58,17 +54,13 @@ export const NetworkBox = ({ type, selected, isOpen, networks, onToggle, onSelec
5854 onClick = { ( ) => onSelect ( network ) }
5955 >
6056 < div className = "w-6 h-6 relative" >
61- < Image
57+ < FallbackImage
6258 src = { network . icon }
6359 fill
6460 alt = { network . name }
6561 sizes = "24px"
6662 className = "object-cover rounded-full"
67- onError = { ( e ) => {
68- ; ( e . target as HTMLImageElement ) . srcset = ''
69- ; ( e . target as HTMLImageElement ) . src =
70- 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"%3E%3Ccircle cx="12" cy="12" r="12" fill="%23ccc"%3E%3C/circle%3E%3Ctext x="12" y="16" font-family="Arial" font-size="14" fill="%23fff" text-anchor="middle"%3E%3F%3C/text%3E%3C/svg%3E'
71- } }
63+ fallbackSvg = 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"%3E%3Ccircle cx="12" cy="12" r="12" fill="%23ccc"%3E%3C/circle%3E%3Ctext x="12" y="16" font-family="Arial" font-size="14" fill="%23fff" text-anchor="middle"%3E%3F%3C/text%3E%3C/svg%3E'
7264 />
7365 </ div >
7466 < span className = "text-sm font-medium text-gray-800" > { network . name } </ span >
0 commit comments