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

function IconNewWindowComponent(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-new-window${loadingKls} ${className}`} width={width} height={height} viewBox="0 0 14 14" fill={useCurrentColor ? 'currentColor' : '#000'} xmlns="http://www.w3.org/2000/svg" {...rest} ref={ref}><path fillRule="evenodd" clipRule="evenodd" d="M6.41663 1.16663H1.74996C1.42779 1.16663 1.16663 1.42779 1.16663 1.74996V12.25C1.16663 12.5721 1.42779 12.8333 1.74996 12.8333H12.25C12.5721 12.8333 12.8333 12.5721 12.8333 12.25V7.58329H11.6666V11.6666H2.33329V2.33329H6.41663V1.16663ZM8.16663 1.16663H8.18735H12.25H12.2707C12.5929 1.16663 12.854 1.42779 12.854 1.74996V5.83329L12.8333 5.83329L11.6874 5.83329L11.6666 5.83329V3.17885L8.20201 6.64359C8.08811 6.7575 7.90344 6.7575 7.78953 6.64359L7.37705 6.23111C7.26315 6.11721 7.26315 5.93254 7.37705 5.81864L10.8619 2.33329H8.18845L8.18735 2.33329L8.16663 2.33329V1.16663Z"/></svg>;
}

const IconNewWindow = React.forwardRef(IconNewWindowComponent);
export default IconNewWindow;
