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

function IconRightComponent(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-right${loadingKls} ${className}`} width={width} height={height} viewBox="0 0 12 12" fill={useCurrentColor ? 'currentColor' : '#000'} xmlns="http://www.w3.org/2000/svg" {...rest} ref={ref}><path fillRule="evenodd" clipRule="evenodd" d="M4.05563 8.12334C3.86036 8.3186 3.86036 8.63518 4.05563 8.83044L4.40918 9.184C4.60444 9.37926 4.92102 9.37926 5.11629 9.184L7.94471 6.35557C8.04287 6.25742 8.09168 6.12861 8.09116 5.99996C8.09168 5.87132 8.04287 5.74251 7.94471 5.64435L5.11629 2.81593C4.92102 2.62066 4.60444 2.62066 4.40918 2.81593L4.05563 3.16948C3.86036 3.36474 3.86036 3.68132 4.05563 3.87659L6.179 5.99996L4.05563 8.12334Z"/></svg>;
}

const IconRight = React.forwardRef(IconRightComponent);
export default IconRight;
