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

function IconDocComponent(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-doc${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="m17.555 11.423.536.536a.788.788 0 0 1 0 1.123l-5.251 5.251h-1.66v-1.659l4.129-4.132 1.123-1.119a.795.795 0 0 1 1.123 0Z" clipRule="evenodd" opacity=".5"/><path fillRule="evenodd" d="M17.5 11.373V6.834a.666.666 0 0 0-.2-.477l-4.606-4.5a.666.666 0 0 0-.466-.19H3.167a.667.667 0 0 0-.667.666v15.334c0 .368.298.666.667.666h13.666a.667.667 0 0 0 .667-.666v-3.994l-4.66 4.66h-1.66v-1.659l4.129-4.132 1.123-1.119a.795.795 0 0 1 1.068-.05ZM12.083 8.52H7.917a.417.417 0 0 0-.417.417v.833c0 .23.187.417.417.417h4.166c.23 0 .417-.187.417-.417v-.833a.417.417 0 0 0-.417-.417Zm0 4.167H7.917a.417.417 0 0 0-.417.416v.834c0 .23.187.416.417.416h4.166c.23 0 .417-.186.417-.416v-.834a.417.417 0 0 0-.417-.416Z" clipRule="evenodd"/></svg>;
}

const IconDoc = React.forwardRef(IconDocComponent);
export default IconDoc;
