You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
spa_instat_tv/src/features/Icon/index.tsx

41 lines
721 B

import React from 'react'
import * as icons from '../../libs/index'
export type IconProps = {
className?: string,
color?: string,
direction?: number,
onClick?: () => void,
refIcon: any,
size?: number | string,
styles?: any,
}
export const Icon: React.FC<IconProps> = ({
className,
color,
direction,
onClick,
refIcon,
size,
styles,
}) => (
<div
className={className || 'icon-container'}
onClick={onClick}
onKeyDown={onClick}
style={{
fill: color,
height: size,
transform: `rotate(${direction}deg)`,
width: size,
...styles,
}}
aria-hidden='true'
>
{
// @ts-ignore
React.createElement(icons[refIcon], {})
}
</div>
)