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

function IconDocumentComponent(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-document${loadingKls} ${className}`} width={width} height={height} viewBox="0 0 48 48" fill={useCurrentColor ? 'currentColor' : '#000'} xmlns="http://www.w3.org/2000/svg" {...rest} ref={ref}><path fillRule="evenodd" clipRule="evenodd" d="M6 4a2 2 0 012-2h25l9 9.429V44a2 2 0 01-2 2H8a2 2 0 01-2-2V4zm24 2v8.039h8V42H10V6h20zM14 28a1 1 0 011-1h10a1 1 0 011 1v2a1 1 0 01-1 1H15a1 1 0 01-1-1v-2zm1-9a1 1 0 00-1 1v2a1 1 0 001 1h18a1 1 0 001-1v-2a1 1 0 00-1-1H15z"/></svg>;
}

const IconDocument = React.forwardRef(IconDocumentComponent);
export default IconDocument;
