import React, { ForwardedRef, useContext } from 'react';
import { OriginIconProps } from '../type';
import { Context } from '../context';

function IconStarComponent(props: OriginIconProps, ref: ForwardedRef<SVGSVGElement>) {
    const { prefix: prefixFromContext } = useContext(Context);
    const { className = '', prefix: prefixFromProps, width = '1em', height = '1em', useCurrentColor = true, spin, ...rest } = props;

    const prefix = prefixFromProps || prefixFromContext || 'font';
    const loadingKls = spin ? ` ${prefix}-icon-loading` : '';
    return <svg className={`${prefix}-icon ${prefix}-icon-Star${loadingKls} ${className}`} width={width} height={height} viewBox="0 0 24 24" fill={useCurrentColor ? 'currentColor' : '#000'} xmlns="http://www.w3.org/2000/svg" {...rest} ref={ref}><path d="M13.9447 5.49284C14.717 7.57981 16.3627 9.22537 18.4496 9.99772L21.2494 11.0335C22.1201 11.3556 22.1201 12.5871 21.2494 12.9092L18.4496 13.945C16.3627 14.7173 14.7171 16.363 13.9447 18.4499L12.909 21.2496C12.5869 22.1204 11.3553 22.1204 11.0332 21.2496L9.99748 18.4499C9.22513 16.363 7.57956 14.7172 5.4926 13.945L2.69283 12.9092C1.82212 12.5871 1.82212 11.3556 2.69283 11.0335L5.4926 9.99772C7.5796 9.22542 9.22517 7.57984 9.99748 5.49284L11.0332 2.69308C11.3553 1.82236 12.5869 1.82236 12.909 2.69308L13.9447 5.49284ZM11.9711 6.61198C10.9689 9.04106 9.04082 10.9691 6.61174 11.9714C9.04051 12.9734 10.9687 14.9011 11.9711 17.3298C12.9733 14.9015 14.9012 12.9736 17.3295 11.9714C14.9009 10.969 12.9732 9.04075 11.9711 6.61198Z"/></svg>;
}

const IconStar = React.forwardRef(IconStarComponent);
export default IconStar;
