Function
Icon
({
className,
children,
active,
disabled,
onClick,
}: Props)
Source from the content-addressed store, hash-verified
| 11 | } |
| 12 | |
| 13 | export default function Icon({ |
| 14 | className, |
| 15 | children, |
| 16 | active, |
| 17 | disabled, |
| 18 | onClick, |
| 19 | }: Props) { |
| 20 | return ( |
| 21 | <div |
| 22 | className={classNames(className, styles.icon, { |
| 23 | [styles.active]: active, |
| 24 | [styles.disabled]: disabled, |
| 25 | })} |
| 26 | onClick={onClick} |
| 27 | tabIndex={0} |
| 28 | onKeyUp={(event) => { |
| 29 | if (!disabled && event.key === 'Enter') { |
| 30 | onClick?.(); |
| 31 | } |
| 32 | }} |
| 33 | > |
| 34 | {children} |
| 35 | </div> |
| 36 | ); |
| 37 | } |
Callers
nothing calls this directly
Tested by
no test coverage detected