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 = false, spin, ...rest } = props;

    const prefix = prefixFromProps || prefixFromContext || 'hkgai';
    const loadingKls = spin ? ` ${prefix}-icon-loading` : '';
    return <svg className={`${prefix}-icon ${prefix}-icon-Star${loadingKls} ${className}`} width={width} height={height} viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" {...rest} ref={ref}><g fillRule="evenodd" clipRule="evenodd" fill={useCurrentColor ? 'currentColor' : '#1C1C1C'}><path d="M8.43747 4.2269L7.6493 6.35689C7.42774 6.95565 6.95566 7.42774 6.35689 7.6493L4.2269 8.43747 6.35689 9.22564C6.95565 9.4472 7.42774 9.91929 7.6493 10.518L8.43747 12.648 9.22564 10.518C9.4472 9.91929 9.91929 9.4472 10.518 9.22564L12.648 8.43747 10.518 7.6493C9.91929 7.42774 9.4472 6.95566 9.22564 6.35689L8.43747 4.2269zM9.31671 3.00107C9.01468 2.18486 7.86026 2.18486 7.55824 3.00107L6.47699 5.9231C6.38203 6.17971 6.17971 6.38203 5.9231 6.47699L3.00107 7.55824C2.18486 7.86026 2.18486 9.01468 3.00107 9.31671L5.9231 10.398C6.17971 10.4929 6.38203 10.6952 6.47699 10.9518L7.55824 13.8739C7.86026 14.6901 9.01468 14.6901 9.31671 13.8739L10.398 10.9518C10.4929 10.6952 10.6952 10.4929 10.9518 10.398L13.8739 9.31671C14.6901 9.01468 14.6901 7.86026 13.8739 7.55824L10.9518 6.47699C10.6952 6.38203 10.4929 6.17971 10.398 5.9231L9.31671 3.00107zM14.6873 12.7014L14.4003 13.4773C14.242 13.905 13.9048 14.2422 13.4771 14.4004L12.7013 14.6875 13.4771 14.9746C13.9048 15.1328 14.242 15.47 14.4003 15.8977L14.6873 16.6736 14.9744 15.8977C15.1327 15.47 15.4699 15.1328 15.8976 14.9746L16.6734 14.6875 15.8976 14.4004C15.4699 14.2422 15.1327 13.905 14.9744 13.4773L14.6873 12.7014zM15.2735 11.5841C15.0722 11.0399 14.3025 11.0399 14.1012 11.5841L13.521 13.1519C13.4577 13.323 13.3228 13.4579 13.1518 13.5212L11.5839 14.1013C11.0398 14.3027 11.0398 15.0723 11.5839 15.2737L13.1518 15.8538C13.3228 15.9171 13.4577 16.052 13.521 16.2231L14.1012 17.7909C14.3025 18.3351 15.0722 18.3351 15.2735 17.7909L15.8537 16.2231C15.917 16.052 16.0519 15.9171 16.2229 15.8538L17.7908 15.2737C18.3349 15.0723 18.3349 14.3027 17.7908 14.1013L16.2229 13.5212C16.0519 13.4579 15.917 13.323 15.8537 13.1519L15.2735 11.5841z"/></g></svg>;
}

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