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

function IconOperateComponent(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-operate${loadingKls} ${className}`} width={width} height={height} xmlns="http://www.w3.org/2000/svg" fill={useCurrentColor ? 'currentColor' : '#000'} viewBox="0 0 20 20" {...rest} ref={ref}><path fillRule="evenodd" d="M16.502 15.15a.82.82 0 0 1 .82.82v.79a.82.82 0 0 1-.82.82H3.498a.82.82 0 0 1-.82-.82v-.79a.82.82 0 0 1 .82-.82h13.004Zm-.274-12.73c.604 0 1.094.49 1.094 1.093v9.425c0 .604-.49 1.094-1.094 1.094H3.772c-.604 0-1.094-.49-1.094-1.094V3.513c0-.604.49-1.093 1.094-1.093h12.456ZM6.804 6.886a.632.632 0 0 0-.624.53l-.008.102v2.625a.632.632 0 0 0 1.256.102l.008-.102V7.518a.632.632 0 0 0-.632-.632Zm6.514 0a.632.632 0 0 0-.624.53l-.008.102v2.625a.632.632 0 0 0 1.255.102l.009-.102V7.518a.632.632 0 0 0-.632-.632ZM10.06 4.94a.632.632 0 0 0-.624.53l-.008.102v4.57a.632.632 0 0 0 1.255.102l.009-.102v-4.57a.632.632 0 0 0-.632-.632Z" clipRule="evenodd"/></svg>;
}

const IconOperate = React.forwardRef(IconOperateComponent);
export default IconOperate;
