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

function IconLaunchComponent(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-launch${loadingKls} ${className}`} width={width} height={height} xmlns="http://www.w3.org/2000/svg" fill={useCurrentColor ? 'currentColor' : '#000'} viewBox="0 0 48 48" {...rest} ref={ref}><path d="M43 40a3 3 0 0 1-3 3H8a3 3 0 0 1-3-3V8a3 3 0 0 1 3-3h14v4H9v30h30V26h4v14Z"/><path d="M41.313 9.514 21.236 29.592l-2.828-2.828L38.485 6.686l2.828 2.828Z"/><path d="M43 5v15h-4V9H28.001V5H43Z"/></svg>;
}

const IconLaunch = React.forwardRef(IconLaunchComponent);
export default IconLaunch;
