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

function IconPreviousComponent(props: OriginIconProps, ref: ForwardedRef<SVGSVGElement>) {
    const { prefix: prefixFromContext } = useContext(Context);
    const { className = '', prefix: prefixFromProps, width = '1em', height = '1em', useCurrentColor = false, spin, ...rest } = props;

    const prefix = prefixFromProps || prefixFromContext || 'hiagent';
    const loadingKls = spin ? ` ${prefix}-icon-loading` : '';
    return <svg className={`${prefix}-icon ${prefix}-icon-previous${loadingKls} ${className}`} width={width} height={height} xmlns="http://www.w3.org/2000/svg" fill={useCurrentColor ? 'currentColor' : 'none'} viewBox="0 0 20 20" {...rest} ref={ref}><path fill={useCurrentColor ? 'currentColor' : '#fff'} fillRule="evenodd" d="m15.23 5.08-7 4.5a.5.5 0 0 0 0 .84l7 4.5a.5.5 0 0 0 .77-.42v-9a.5.5 0 0 0-.77-.42Z" clipRule="evenodd"/><path fill={useCurrentColor ? 'currentColor' : '#fff'} d="M5.083 15V5a.75.75 0 0 1 1.5 0v10a.75.75 0 0 1-1.5 0Z"/></svg>;
}

const IconPrevious = React.forwardRef(IconPreviousComponent);
export default IconPrevious;
