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

function IconOpenComponent(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-open${loadingKls} ${className}`} width={width} height={height} xmlns="http://www.w3.org/2000/svg" fill={useCurrentColor ? 'currentColor' : '#000'} viewBox="0 0 14 14" {...rest} ref={ref}><path fillRule="evenodd" d="M8.278 2.28a.525.525 0 0 1 0-.743l.618-.62a.525.525 0 1 1 .743.743l-.619.62a.525.525 0 0 1-.742 0ZM6.356 3.534a.573.573 0 0 0-.572.573v4.387a.496.496 0 0 1-.849.348l-.482-.488a.665.665 0 0 0-.895-.051.614.614 0 0 0-.173.77c.473.86 1.263 2.071 2.26 2.838.404.311.954.425 1.575.425h1.853a1.838 1.838 0 0 0 1.838-1.837v-1.61a.67.67 0 0 0-.472-.64l-3.162-.985a.496.496 0 0 1-.348-.474V4.108a.573.573 0 0 0-.573-.573Zm0-.992c.864 0 1.565.7 1.565 1.565v2.317l2.813.876c.695.217 1.168.86 1.168 1.588V10.5a2.83 2.83 0 0 1-2.829 2.83H7.22c-.716 0-1.525-.128-2.18-.632-1.162-.894-2.033-2.252-2.524-3.145-.385-.7-.173-1.541.417-2.02a1.656 1.656 0 0 1 1.86-.156v-3.27c0-.863.7-1.564 1.563-1.564ZM9.232 3.68a.525.525 0 1 0 0 1.05h.875a.525.525 0 1 0 0-1.05h-.875Zm-4.81-1.402a.525.525 0 0 0 0-.742l-.618-.62a.525.525 0 0 0-.742.743l.618.62a.525.525 0 0 0 .743 0ZM3.468 3.68a.525.525 0 1 1 0 1.05h-.875a.525.525 0 1 1 0-1.05h.875Z" clipRule="evenodd"/></svg>;
}

const IconOpen = React.forwardRef(IconOpenComponent);
export default IconOpen;
