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

function IconWhiteListComponent(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-whiteList${loadingKls} ${className}`} width={width} height={height} viewBox="0 0 18 18" fill={useCurrentColor ? 'currentColor' : '#000'} xmlns="http://www.w3.org/2000/svg" {...rest} ref={ref}><path d="M8.57471 9.07874C8.98925 9.07874 9.32544 9.41425 9.32568 9.82874C9.32568 10.2434 8.9894 10.5797 8.57471 10.5797H6.07178C4.18276 10.5799 2.65188 12.1116 2.65186 14.0006V14.8346C2.65186 14.8807 2.68879 14.9186 2.73486 14.9186H11.0776C11.4923 14.9186 11.8286 15.2549 11.8286 15.6696C11.8284 16.0841 11.4922 16.4205 11.0776 16.4205H2.73486C1.8594 16.4205 1.1499 15.7101 1.1499 14.8346V14.0006C1.14993 11.2822 3.35338 9.07887 6.07178 9.07874H8.57471ZM15.5073 9.34924C15.7726 9.03053 16.2462 8.98725 16.5649 9.25256C16.8831 9.51783 16.9264 9.99064 16.6616 10.3092L13.5356 14.0641C13.3982 14.229 13.1965 14.3269 12.9819 14.3336C12.7674 14.3402 12.56 14.2553 12.4126 14.0992L10.5327 12.1071C10.2481 11.8055 10.2615 11.3302 10.563 11.0455C10.8645 10.7611 11.3399 10.7754 11.6245 11.0768L12.9233 12.4528L15.5073 9.34924ZM8.57471 1.56995C10.3717 1.56995 11.8286 3.02686 11.8286 4.82385C11.8284 6.62065 10.3716 8.07678 8.57471 8.07678C6.77795 8.07667 5.32103 6.62058 5.3208 4.82385C5.3208 3.02693 6.77781 1.57006 8.57471 1.56995ZM8.57471 3.07092C7.60719 3.07104 6.82275 3.85631 6.82275 4.82385C6.82299 5.7912 7.60733 6.57569 8.57471 6.57581C9.54218 6.57581 10.3264 5.79127 10.3267 4.82385C10.3267 3.85624 9.54232 3.07092 8.57471 3.07092Z"/></svg>;
}

const IconWhiteList = React.forwardRef(IconWhiteListComponent);
export default IconWhiteList;
