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 || 'hiagent';
    const loadingKls = spin ? ` ${prefix}-icon-loading` : '';
    return <svg className={`${prefix}-icon ${prefix}-icon-star${loadingKls} ${className}`} width={width} height={height} viewBox="0 0 12 12" fill={useCurrentColor ? 'currentColor' : '#000'} xmlns="http://www.w3.org/2000/svg" {...rest} ref={ref}><path fillRule="evenodd" clipRule="evenodd" d="M5.18961 1.50584C5.41887 1.04131 6.08127 1.04131 6.31053 1.50584L7.47809 3.87158L10.0888 4.25094C10.6015 4.32543 10.8062 4.95541 10.4352 5.317L8.54607 7.15847L8.99204 9.75867C9.07961 10.2692 8.54371 10.6586 8.0852 10.4175L5.75007 9.18988L3.41494 10.4175C2.95642 10.6586 2.42053 10.2692 2.5081 9.75867L2.95407 7.15847L1.06491 5.317C0.693966 4.95542 0.898659 4.32543 1.4113 4.25094L4.02205 3.87158L5.18961 1.50584ZM5.75007 2.62977L4.83153 4.49093C4.74049 4.6754 4.56451 4.80325 4.36095 4.83283L2.30703 5.13129L3.79326 6.58C3.94056 6.72358 4.00778 6.93046 3.97301 7.1332L3.62216 9.17882L5.45923 8.21301C5.64131 8.11729 5.85883 8.11729 6.04091 8.21301L7.87798 9.17882L7.52713 7.1332C7.49236 6.93046 7.55958 6.72358 7.70688 6.58L9.19311 5.13129L7.13919 4.83283C6.93562 4.80325 6.75965 4.6754 6.66861 4.49093L5.75007 2.62977Z"/></svg>;
}

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