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

function IconMagicComponent(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-magic${loadingKls} ${className}`} width={width} height={height} viewBox="0 0 14 14" fill={useCurrentColor ? 'currentColor' : '#000'} xmlns="http://www.w3.org/2000/svg" {...rest} ref={ref}><g clipPath="url(#svg_2f3a4fccca__clip0_2798_6914)"><path d="M7.00008 0.293457C7.20472 0.293457 7.37353 0.453551 7.39941 0.65918C7.4637 1.17086 7.58261 1.66551 7.75033 2.13631L7.98446 2.7111C8.66802 4.19667 9.85377 5.39741 11.3204 6.08976L11.8878 6.32731L12.0729 6.39168C12.5081 6.53651 12.9624 6.63861 13.431 6.69303C13.5861 6.71105 13.7067 6.84191 13.7067 7.00008L13.701 7.05819C13.6757 7.18928 13.5666 7.29138 13.431 7.30713L13.3586 7.31624C12.8489 7.38098 12.3565 7.50167 11.8878 7.67285L11.3204 7.9104C9.85377 8.60275 8.66802 9.80349 7.98446 11.2891L7.75033 11.8639C7.58261 12.3347 7.4637 12.8293 7.39941 13.341L7.38346 13.4156C7.33108 13.5841 7.17921 13.7067 7.00008 13.7067L6.92546 13.6993C6.7798 13.6707 6.66163 13.5601 6.6167 13.4156L6.60075 13.341C6.53646 12.8293 6.41755 12.3347 6.24984 11.8639L6.01571 11.2891C5.33214 9.80349 4.14639 8.60275 2.67977 7.9104L2.11239 7.67285C1.68288 7.51599 1.23347 7.40128 0.769124 7.33333L0.569173 7.30713C0.414044 7.28911 0.293457 7.15825 0.293457 7.00008C0.293457 6.84191 0.414044 6.71105 0.569173 6.69303C1.0378 6.63861 1.4921 6.53651 1.92725 6.39168L2.11239 6.32731L2.67977 6.08976C4.14639 5.39741 5.33214 4.19667 6.01571 2.7111L6.24984 2.13631C6.41755 1.66551 6.53646 1.17086 6.60075 0.65918C6.62663 0.453551 6.79544 0.293457 7.00008 0.293457Z"/></g><defs><clipPath id="svg_2f3a4fccca__clip0_2798_6914"><path d="M0 0H14V14H0z"/></clipPath></defs></svg>;
}

const IconMagic = React.forwardRef(IconMagicComponent);
export default IconMagic;
