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

function IconCaretLeftComponent(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-caret-left${loadingKls} ${className}`} width={width} height={height} viewBox="0 0 48 48" fill={useCurrentColor ? 'currentColor' : '#000'} xmlns="http://www.w3.org/2000/svg" {...rest} ref={ref}><path d="M29.8391 10.1366C31.1756 9.11057 33.1001 10.0709 33.1001 11.764L33.1001 36.2362C33.1001 37.9292 31.1756 38.8896 29.8391 37.8635L13.9 25.6274C12.8335 24.8086 12.8335 23.1915 13.9 22.3727L29.8391 10.1366Z"/></svg>;
}

const IconCaretLeft = React.forwardRef(IconCaretLeftComponent);
export default IconCaretLeft;
