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

function IconLineComponent(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${loadingKls} ${className}`} width={width} height={height} viewBox="0 0 14 14" fill={useCurrentColor ? 'currentColor' : '#000'} xmlns="http://www.w3.org/2000/svg" {...rest} ref={ref}><path d="M12.808 7.58366H1.04168C0.719511 7.58366 0.458344 7.32249 0.458344 7.00033C0.458344 6.67816 0.719511 6.41699 1.04168 6.41699H12.808C13.1304 6.41699 13.3917 6.67853 13.3913 7.00094C13.391 7.32287 13.1299 7.58366 12.808 7.58366Z"/></svg>;
}

const IconLine = React.forwardRef(IconLineComponent);
export default IconLine;
