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

function IconRefreshComponent(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-refresh${loadingKls} ${className}`} width={width} height={height} xmlns="http://www.w3.org/2000/svg" fill={useCurrentColor ? 'currentColor' : '#000'} viewBox="0 0 16 16" {...rest} ref={ref}><g fillRule="evenodd" clipRule="evenodd"><path d="M9.66667 6.66667C9.48257 6.66667 9.33333 6.51743 9.33333 6.33333V5.66667C9.33333 5.48257 9.48257 5.33333 9.66667 5.33333L11.8303 5.3334C10.987 4.12437 9.58586 3.33333 8 3.33333C5.42267 3.33333 3.33333 5.42267 3.33333 8C3.33333 10.5773 5.42267 12.6667 8 12.6667C10.0353 12.6667 11.7663 11.3637 12.4043 9.54643C12.4483 9.42121 12.5643 9.33358 12.697 9.33358L13.4756 9.33356C13.668 9.33356 13.8109 9.51263 13.7566 9.69728C13.0244 12.1844 10.7242 14 8 14C4.68629 14 2 11.3137 2 8C2 4.68629 4.68629 2 8 2C9.88507 2 11.5671 2.86932 12.6671 4.22893L12.6667 2.33333C12.6667 2.14924 12.8159 2 13 2H13.6667C13.8508 2 14 2.14924 14 2.33333V6C14 6.35145 13.728 6.63939 13.3831 6.66484L13.3333 6.66667H9.66667Z"/><path d="M12.4665 2.33334C12.4665 2.03878 12.7053 1.8 12.9998 1.8H13.6665C13.961 1.8 14.1998 2.03878 14.1998 2.33334V6C14.1998 6.45698 13.8462 6.8312 13.3976 6.8643L13.3902 6.86484L13.3331 6.8668L9.66647 6.86667C9.37192 6.86667 9.13314 6.62789 9.13314 6.33334V5.66667C9.13314 5.37212 9.37192 5.13334 9.66648 5.13334L11.4254 5.13339C10.6058 4.15501 9.37539 3.53334 7.9998 3.53334C5.53293 3.53334 3.53314 5.53313 3.53314 8C3.53314 10.4669 5.53293 12.4667 7.9998 12.4667C9.94757 12.4667 11.6046 11.2198 12.2154 9.48018C12.2856 9.28025 12.4736 9.13358 12.6968 9.13358L13.4754 9.13356C13.7921 9.13356 14.0429 9.4322 13.9482 9.75376C13.1917 12.3237 10.8151 14.2 7.9998 14.2C4.57564 14.2 1.7998 11.4242 1.7998 8C1.7998 4.57584 4.57564 1.8 7.9998 1.8C9.75453 1.8 11.3391 2.52915 12.4668 3.70043L12.4665 2.33334ZM12.6669 4.22894C12.6022 4.14897 12.5355 4.0707 12.4668 3.9942C11.3683 2.77007 9.774 2 7.9998 2C4.6861 2 1.9998 4.68629 1.9998 8C1.9998 11.3137 4.6861 14 7.9998 14C10.724 14 13.0242 12.1844 13.7564 9.69728C13.8107 9.51263 13.6678 9.33356 13.4754 9.33356L12.6968 9.33358C12.5641 9.33358 12.4481 9.42121 12.4041 9.54643C11.7661 11.3637 10.0351 12.6667 7.9998 12.6667C5.42248 12.6667 3.33314 10.5773 3.33314 8C3.33314 5.42267 5.42248 3.33334 7.9998 3.33334C9.49645 3.33334 10.8285 4.03788 11.6825 5.1334C11.7334 5.1987 11.7826 5.26539 11.8301 5.33341L9.66647 5.33334C9.48238 5.33334 9.33314 5.48257 9.33314 5.66667V6.33334C9.33314 6.51743 9.48238 6.66667 9.66647 6.66667H13.3331L13.3829 6.66484C13.7278 6.63939 13.9998 6.35146 13.9998 6V2.33334C13.9998 2.14924 13.8506 2 13.6665 2H12.9998C12.8157 2 12.6665 2.14924 12.6665 2.33334L12.6669 4.22894Z"/></g></svg>;
}

const IconRefresh = React.forwardRef(IconRefreshComponent);
export default IconRefresh;
