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

function IconGuaranteeComponent(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 || 'hiagent';
    const loadingKls = spin ? ` ${prefix}-icon-loading` : '';
    return <svg className={`${prefix}-icon ${prefix}-icon-guarantee${loadingKls} ${className}`} width={width} height={height} xmlns="http://www.w3.org/2000/svg" fill={useCurrentColor ? 'currentColor' : 'currentColor'} viewBox="0 0 100 100" {...rest} ref={ref}><rect width="29.36" height="29.36" x="15.822" y="15.41" fill={useCurrentColor ? 'currentColor' : '#EAEDF1'} opacity=".7" rx="2"/><rect width="32.817" height="32.817" x="14.094" y="49.111" fill={useCurrentColor ? 'currentColor' : '#DDE2E9'} rx="16.409"/><rect width="25.623" height="25.623" x="49.668" y="66.471" fill={useCurrentColor ? 'currentColor' : '#EAEDF1'} opacity=".7" rx="2" transform="rotate(-45 49.668 66.471)"/><path fill={useCurrentColor ? 'currentColor' : '#DDE2E9'} d="M65.121 16.552c.856-1.523 2.89-1.523 3.745 0L83.043 41.77c.894 1.59-.159 3.631-1.873 3.631H52.817c-1.714 0-2.766-2.04-1.872-3.631L65.12 16.552Z"/></svg>;
}

const IconGuarantee = React.forwardRef(IconGuaranteeComponent);
export default IconGuarantee;
