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

function IconIdeComponent(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-ide${loadingKls} ${className}`} width={width} height={height} xmlns="http://www.w3.org/2000/svg" fill={useCurrentColor ? 'currentColor' : '#000'} viewBox="0 0 24 24" {...rest} ref={ref}><path fillRule="evenodd" d="M21.5 2.5a1 1 0 0 1 1 1V17a1 1 0 0 1-1 1H13v1.5h3.5a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-9A.5.5 0 0 1 7 21v-1a.5.5 0 0 1 .5-.5H11V18H2.5a1 1 0 0 1-1-1V3.5a.999.999 0 0 1 1-1h19Zm-1 2h-17V16h17V4.5Zm-5.367 1.854 1.933.517-2.07 7.727-1.933-.518 2.07-7.726ZM10.744 6l1.415 1.414-2.843 2.841 2.634 2.634-1.413 1.415-3.891-3.89.012-.013-.159-.159L10.743 6Z" clipRule="evenodd"/></svg>;
}

const IconIde = React.forwardRef(IconIdeComponent);
export default IconIde;
