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

function IconMdComponent(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-Md${loadingKls} ${className}`} width={width} height={height} viewBox="0 0 18 18" fill={useCurrentColor ? 'currentColor' : '#000'} xmlns="http://www.w3.org/2000/svg" {...rest} ref={ref}><path fillRule="evenodd" clipRule="evenodd" d="M4.33325 2.3335C3.22869 2.3335 2.33325 3.22893 2.33325 4.3335V13.6668C2.33325 14.7714 3.22869 15.6668 4.33325 15.6668H13.6666C14.7712 15.6668 15.6666 14.7714 15.6666 13.6668V4.3335C15.6666 3.22893 14.7712 2.3335 13.6666 2.3335H4.33325ZM6.42538 5.25H5.5H4.37538C4.16769 5.25 4 5.43 4 5.65154V12.8485C4 13.0708 4.16769 13.2508 4.37462 13.2508H5.5C5.70692 13.2508 5.87462 13.0708 5.87462 12.8492V7.34923L8.20923 12.5746C8.24077 12.6731 8.33231 12.75 8.44769 12.75H9.55308C9.60632 12.75 9.65816 12.7329 9.70106 12.7014C9.74395 12.6698 9.77565 12.6254 9.79154 12.5746L12.1246 7.34846V12.8477C12.1246 13.07 12.2923 13.25 12.5 13.25H13.6246C13.8323 13.25 14 13.07 14 12.8477V5.65154C14 5.43 13.8323 5.25 13.6246 5.25H11.5746C11.5263 5.24993 11.4791 5.26384 11.4385 5.29005C11.398 5.31626 11.3659 5.35364 11.3462 5.39769L9 10.6515L6.65385 5.39769C6.61308 5.30769 6.52385 5.25 6.42538 5.25Z"/></svg>;
}

const IconMd = React.forwardRef(IconMdComponent);
export default IconMd;
