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

function IconHeartComponent(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-Heart${loadingKls} ${className}`} width={width} height={height} viewBox="0 0 48 48" fill={useCurrentColor ? 'currentColor' : '#000'} xmlns="http://www.w3.org/2000/svg" {...rest} ref={ref}><path fillRule="evenodd" clipRule="evenodd" d="M22.3639 11.3261C18.7649 7.73341 12.9281 7.73341 9.32913 11.3261C5.79116 14.8581 5.73343 20.5476 9.15556 24.149L9.33944 24.3373L23.5978 38.5708C23.8194 38.7921 24.1806 38.7921 24.4023 38.5709L38.6605 24.3374L38.8445 24.149C42.2666 20.5476 42.2088 14.8581 38.6709 11.3261C35.0719 7.73341 29.2351 7.73341 25.6361 11.3261L24 12.9595L22.3639 11.3261ZM24 6.6488C18.5847 2.69986 10.9474 3.16633 6.05698 8.04835C0.730682 13.3653 0.648877 21.9362 5.81198 27.3542L5.8219 27.3645L6.04672 27.5947L20.3255 41.8487C22.3553 43.8749 25.6447 43.8749 27.6745 41.8487L41.9534 27.5946L42.1783 27.3645L42.1881 27.3541C47.3511 21.9361 47.2693 13.3653 41.9431 8.04835C37.0526 3.16634 29.4154 2.69985 24 6.6488Z"/></svg>;
}

const IconHeart = React.forwardRef(IconHeartComponent);
export default IconHeart;
