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

function IconFrameComponent(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-Frame${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="M1 3.96629C1 2.32805 2.32805 1 3.96629 1H14.0337C15.6719 1 17 2.32805 17 3.96629V14.0337C17 15.6719 15.6719 17 14.0337 17H3.96629C2.32805 17 1 15.6719 1 14.0337V3.96629ZM3.96629 2.61798C3.22164 2.61798 2.61798 3.22164 2.61798 3.96629V14.0337C2.61798 14.7783 3.22164 15.382 3.96629 15.382H14.0337C14.7783 15.382 15.382 14.7783 15.382 14.0337V3.96629C15.382 3.22164 14.7783 2.61798 14.0337 2.61798H3.96629ZM5.49438 6.30337C5.49438 5.85658 5.85658 5.49438 6.30337 5.49438H11.6966C12.1435 5.49438 12.5056 5.85658 12.5056 6.30337C12.5056 6.75017 12.1435 7.11236 11.6966 7.11236H9.80899V11.6966C9.80899 12.1435 9.44683 12.5056 9 12.5056C8.55317 12.5056 8.19101 12.1435 8.19101 11.6966V7.11236H6.30337C5.85658 7.11236 5.49438 6.75017 5.49438 6.30337Z"/></svg>;
}

const IconFrame = React.forwardRef(IconFrameComponent);
export default IconFrame;
