Total Complexity | 1 |
Complexity/F | 0 |
Lines of Code | 35 |
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 |
||
19 | aria-hidden="true" |
||
20 | className={icon} |
||
21 | title={accessibleText} |
||
22 | /> |
||
23 | <span data-c-visibility="invisible"> |
||
24 | {accessibleText} |
||
25 | </span> |
||
26 | </> |
||
27 | ) : ( |
||
28 | <i className={icon} /> |
||
29 | )} |
||
30 | </> |
||
31 | ); |
||
32 | }; |
||
33 | |||
34 | export default Icon; |
||
35 |