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

function IconDataExternalComponent(props: OriginIconProps, ref: ForwardedRef<SVGSVGElement>) {
    const { prefix: prefixFromContext } = useContext(Context);
    const { className = '', prefix: prefixFromProps, width = '1em', height = '1em', useCurrentColor = false, spin, ...rest } = props;

    const prefix = prefixFromProps || prefixFromContext || 'hiagent';
    const loadingKls = spin ? ` ${prefix}-icon-loading` : '';
    return <svg className={`${prefix}-icon ${prefix}-icon-data-external${loadingKls} ${className}`} width={width} height={height} xmlns="http://www.w3.org/2000/svg" fill={useCurrentColor ? 'currentColor' : 'none'} viewBox="0 0 32 32" {...rest} ref={ref}><path fill={useCurrentColor ? 'currentColor' : '#38C3FF'} fillRule="evenodd" d="M8 2a4 4 0 0 0-4 4v20a4 4 0 0 0 4 4h16a4 4 0 0 0 4-4V12L18 2H8Z" clipRule="evenodd"/><path fill={useCurrentColor ? 'currentColor' : '#fff'} fillRule="evenodd" d="M15.991 22.922c3.687 0 6.68-.932 6.68-2.089V18.33c0 1.157-2.993 2.089-6.68 2.089-3.686 0-6.68-.932-6.68-2.089v2.503c0 1.15 2.987 2.089 6.68 2.089ZM9.32 21.809c0 1.156 2.986 2.088 6.672 2.088 3.687 0 6.68-.932 6.687-2.088v2.503c0 1.156-2.993 2.088-6.68 2.088-3.693 0-6.68-.939-6.68-2.088v-2.503Z" clipRule="evenodd" opacity=".8"/><path fill={useCurrentColor ? 'currentColor' : '#fff'} fillRule="evenodd" d="M15.991 19.443c3.687 0 6.68-.932 6.68-2.088v-1.667c0-1.156-2.993-2.088-6.68-2.088-3.686 0-6.68.932-6.68 2.088v1.667c0 1.15 2.987 2.088 6.68 2.088Z" clipRule="evenodd"/><path fill={useCurrentColor ? 'currentColor' : '#80DBFF'} d="m18 2 10 10h-6a4 4 0 0 1-4-4V2Z"/></svg>;
}

const IconDataExternal = React.forwardRef(IconDataExternalComponent);
export default IconDataExternal;
