fix remaining eslint error
This commit is contained in:
parent
dc84af9937
commit
922d75f471
15 changed files with 30 additions and 28 deletions
|
@ -9,9 +9,7 @@ interface Props {
|
|||
}
|
||||
|
||||
const Icon = ({ icon, className, style }: Props) => {
|
||||
let [width, height, , , paths] = icon.icon;
|
||||
|
||||
paths = Array.isArray(paths) ? paths : [paths];
|
||||
const [width, height, , , paths] = icon.icon;
|
||||
|
||||
return (
|
||||
<svg
|
||||
|
@ -21,7 +19,7 @@ const Icon = ({ icon, className, style }: Props) => {
|
|||
className={className}
|
||||
style={style}
|
||||
>
|
||||
{paths.map((path, index) => (
|
||||
{(Array.isArray(paths) ? paths : [paths]).map((path, index) => (
|
||||
<path key={`svg_path_${index}`} d={path} />
|
||||
))}
|
||||
</svg>
|
||||
|
|
Reference in a new issue