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

function IconJavascriptComponent(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-javascript${loadingKls} ${className}`} width={width} height={height} viewBox="0 0 18 18" fill={useCurrentColor ? 'currentColor' : 'none'} xmlns="http://www.w3.org/2000/svg" {...rest} ref={ref}><path d="M1.566 1.04408L2.664 15.1741C2.682 15.3901 2.826 15.5701 3.024 15.6241L8.838 17.4601C8.946 17.4961 9.054 17.4961 9.162 17.4601L14.976 15.6241C15.174 15.5521 15.318 15.3721 15.336 15.1741L16.434 1.04408C16.452 0.738084 16.218 0.486084 15.912 0.486084H2.088C1.782 0.486084 1.53 0.738084 1.566 1.04408Z" fill={useCurrentColor ? 'currentColor' : '#D3B900'}/><path d="M9 2.10938H15.1523L14.0625 14.7656L9 16.1719" fill={useCurrentColor ? 'currentColor' : '#FFDA00'}/><path d="M7.03125 3.33984H8.26172V14.1328L4.04297 12.7266V11.4961L7.03125 12.375V3.33984ZM14.5898 3.33984H9.66797V10.0195L12.832 9.49219L12.4805 12.3047L9.66797 12.832V14.0625L13.5352 13.2539L14.0273 8.33203L10.6875 8.75391V4.53516H14.4492L14.5898 3.33984Z" fill={useCurrentColor ? 'currentColor' : '#fff'}/></svg>;
}

const IconJavascript = React.forwardRef(IconJavascriptComponent);
export default IconJavascript;
