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

function IconFlowControlComponent(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-flow-control${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 fillRule="evenodd" clipRule="evenodd" d="M38 4a6 6 0 012 11.658V25h2a2 2 0 012 2v15a2 2 0 01-2 2H6a2 2 0 01-2-2V27a2 2 0 012-2h2v-9.341A6.002 6.002 0 0110 4a6 6 0 012 11.658V25h10v-9.341a6 6 0 114 0V25h10v-9.341A6 6 0 0138 4zM8 29v11h32V29H8zm28 4a1 1 0 00-1-1H25a1 1 0 00-1 1v2a1 1 0 001 1h10a1 1 0 001-1v-2zm-16-1v4h-4v-4h4zM8 10a2 2 0 114 0 2 2 0 01-4 0zm30-2a2 2 0 100 4 2 2 0 000-4zm-16 2a2 2 0 114 0 2 2 0 01-4 0z"/></svg>;
}

const IconFlowControl = React.forwardRef(IconFlowControlComponent);
export default IconFlowControl;
