main
tsx 25 lines 581 Bytes
Raw
1 import 'react'
2 import './icon.css'
3 import type { IconProps as ParentIconProps } from './index.js'
4 import type { JSX } from 'react'
5
6 interface IconProps extends ParentIconProps {
7 src: string
8 name: string
9 }
10
11 export const DEFAULT_HEIGHT = 16
12 export const DEFAULT_WIDTH = 16
13
14 export function Icon (props: IconProps): JSX.Element {
15 return (
16 <>
17 <img
18 {...props}
19 height={props.height ?? DEFAULT_HEIGHT}
20 width={props.width ?? DEFAULT_WIDTH}
21 className={`Icon${props.onClick != null ? ' ClickableIcon' : ''} Libp2pIcon`}
22 />
23 </>
24 )
25 }