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

function IconDrawerComponent(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-drawer${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="M42 44a2 2 0 002-2V23L36.346 5.448C36.076 4.584 35.31 4 34.446 4H13.202c-.863 0-1.628.584-1.899 1.448L4 23v19a2 2 0 002 2h36zM33.166 8.228H14.813L8 23h12v8.4h8V23h12L33.166 8.228zM8 27.2h8v7.4a1 1 0 001 1h14a1 1 0 001-1v-7.4h8v12.6H8V27.2z"/></svg>;
}

const IconDrawer = React.forwardRef(IconDrawerComponent);
export default IconDrawer;
