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

function IconUnfoldComponent(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-unfold${loadingKls} ${className}`} width={width} height={height} xmlns="http://www.w3.org/2000/svg" fill={useCurrentColor ? 'currentColor' : '#000'} viewBox="0 0 24 24" {...rest} ref={ref}><path fillRule="evenodd" d="m10.55 12.742.708.708a.5.5 0 0 1 0 .708l-4.844 4.84 2.96.002c.222 0 .304.024.384.066a.47.47 0 0 1 .19.19c.044.08.066.162.066.384v.72c0 .22-.022.302-.066.384a.454.454 0 0 1-.19.19c-.08.042-.16.066-.384.066h-5.36a1 1 0 0 1-1-1v-5.36c0-.222.024-.302.068-.384a.454.454 0 0 1 .188-.19c.082-.042.162-.066.386-.066h.718c.222 0 .304.024.384.066a.47.47 0 0 1 .19.19c.044.08.066.162.066.384v2.93l4.83-4.828a.5.5 0 0 1 .706 0ZM20 3a1 1 0 0 1 1 1v5.5a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5v-3l-4.78 4.78a.5.5 0 0 1-.706 0l-.706-.708a.498.498 0 0 1 0-.708L17.672 5H14.5a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5H20Z" clipRule="evenodd"/></svg>;
}

const IconUnfold = React.forwardRef(IconUnfoldComponent);
export default IconUnfold;
