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

function IconOrientationComponent(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-orientation${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="M8 6.587c0-1.214.416-2.203 1.087-2.885.67-.679 1.655-1.115 2.913-1.115 1.258 0 2.243.436 2.913 1.115.671.682 1.087 1.67 1.087 2.885 0 .615-.111 1.413-.517 2.092-.38.636-1.069 1.256-2.427 1.493a1 1 0 0 0-.815.823L12 12.452l-.24-1.457a1 1 0 0 0-.786-.817C8.817 9.734 8 7.71 8 6.587Zm4-6c-1.742 0-3.257.615-4.337 1.712C6.584 3.393 6 4.904 6 6.587c0 1.605 1.023 4.421 3.89 5.369l.904 5.467c.226 1.364 2.186 1.364 2.412 0l.899-5.44c1.509-.423 2.495-1.275 3.094-2.278.662-1.107.801-2.31.801-3.118 0-1.683-.584-3.194-1.663-4.288C15.257 1.202 13.742.587 12 .587ZM7.847 15.735a1 1 0 1 0-.438-1.951c-1.586.356-2.987.904-4.018 1.62-1.012.703-1.835 1.696-1.835 2.952 0 .898.427 1.67 1.03 2.281.597.607 1.412 1.108 2.341 1.507 1.861.8 4.363 1.27 7.073 1.27s5.212-.47 7.073-1.27c.929-.399 1.744-.9 2.342-1.507.602-.611 1.03-1.383 1.03-2.28 0-1.257-.824-2.25-1.835-2.952-1.032-.717-2.433-1.265-4.018-1.621a1 1 0 0 0-.44 1.95c1.43.322 2.565.791 3.316 1.313.771.536.977 1.002.977 1.31 0 .222-.101.518-.455.877-.358.364-.926.737-1.706 1.073-1.557.669-3.778 1.107-6.284 1.107-2.505 0-4.726-.439-6.283-1.107-.78-.336-1.348-.71-1.707-1.073-.353-.36-.454-.655-.454-.878 0-.307.205-.773.976-1.309.75-.522 1.886-.99 3.315-1.312Z" clipRule="evenodd"/></svg>;
}

const IconOrientation = React.forwardRef(IconOrientationComponent);
export default IconOrientation;
