Total Complexity | 1 |
Complexity/F | 0 |
Lines of Code | 29 |
Function Count | 0 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import * as React from "react"; |
||
2 | |||
3 | interface IconProps { |
||
4 | icon: string; |
||
5 | accessibleText: string; |
||
6 | sematicIcon: boolean; |
||
7 | } |
||
8 | |||
9 | const Icon: React.FunctionComponent<IconProps> = ({ |
||
10 | icon, |
||
11 | accessibleText, |
||
12 | sematicIcon, |
||
13 | }) => { |
||
14 | return ( |
||
15 | <> |
||
16 | {sematicIcon ? ( |
||
17 | <> |
||
18 | <i aria-hidden="true" className={icon} title={accessibleText} /> |
||
19 | <span data-c-visibility="invisible">{accessibleText}</span> |
||
20 | </> |
||
21 | ) : ( |
||
22 | <i className={icon} /> |
||
23 | )} |
||
24 | </> |
||
25 | ); |
||
26 | }; |
||
27 | |||
28 | export default Icon; |
||
29 |