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

function IconLineChartComponent(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-line-chart${loadingKls} ${className}`} width={width} height={height} xmlns="http://www.w3.org/2000/svg" fill={useCurrentColor ? 'currentColor' : '#000'} viewBox="0 0 20 20" {...rest} ref={ref}><path d="M5.833 15.417v1.666c0 .46.373.834.834.834h6.666c.46 0 .834-.373.834-.834v-1.666H5.833Z" opacity=".5"/><path fillRule="evenodd" d="M2.5 2.083a.833.833 0 0 0-.833.834v11.666c0 .46.373.834.833.834h15c.46 0 .834-.373.834-.834V2.917a.833.833 0 0 0-.834-.834h-15Zm7.021 2.73a.208.208 0 0 0-.367-.015L7.04 8.42H4.974a.208.208 0 0 0-.209.208v1.25c0 .115.094.208.209.208h3.024l1.214-2.08 2.18 4.517c.066.138.254.16.35.04l1.976-2.477h1.308a.208.208 0 0 0 .209-.208v-1.25a.208.208 0 0 0-.209-.208h-2.11l-1.03 1.291-2.365-4.9Z" clipRule="evenodd"/></svg>;
}

const IconLineChart = React.forwardRef(IconLineChartComponent);
export default IconLineChart;
