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

function IconLightningComponent(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-lightning${loadingKls} ${className}`} width={width} height={height} xmlns="http://www.w3.org/2000/svg" fill={useCurrentColor ? 'currentColor' : '#000'} viewBox="0 0 16 16" {...rest} ref={ref}><path d="M12.173.7a.667.667 0 0 1 .524 1.079L9.878 5.367h3.629a.667.667 0 0 1 .49 1.119l-8 8.666a.666.666 0 0 1-1.135-.622L6.31 9.033H2.507a.667.667 0 0 1-.59-.976l3.666-7L5.63.98A.667.667 0 0 1 6.173.7h6Zm-8.565 7h3.565a.667.667 0 0 1 .645.837l-.986 3.744L11.984 6.7H8.507a.667.667 0 0 1-.524-1.079l2.819-3.588H6.576L3.608 7.7Z"/></svg>;
}

const IconLightning = React.forwardRef(IconLightningComponent);
export default IconLightning;
