Passed
Push — task/application-handle-step-s... ( 5f39f9...d6d197 )
by Yonathan
05:39
created

resources/assets/js/components/Icon.tsx   A

Complexity

Total Complexity 1
Complexity/F 0

Size

Lines of Code 29
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 20
dl 0
loc 29
rs 10
c 0
b 0
f 0
wmc 1
mnd 1
bc 1
fnc 0
bpm 0
cpm 0
noi 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