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

function IconProtectionComponent(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-protection${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}><path d="M8.22656 1.4541C8.39372 1.45434 8.5293 1.5906 8.5293 1.75781V2.52832C11.5948 2.79711 14.0374 5.05885 14.3496 7.90723C14.3648 8.0096 14.3742 8.11453 14.376 8.2207V8.25977C14.376 8.27827 14.3754 8.29702 14.375 8.31543C14.3746 8.33269 14.3748 8.35003 14.374 8.36719L14.376 8.36914V8.97461C14.3759 9.30924 14.1042 9.58007 13.7695 9.58008H8.52148V13.3408C8.52126 14.3433 7.70851 15.156 6.70605 15.1562C5.70338 15.1562 4.88987 14.3434 4.88965 13.3408V12.9727C4.88965 12.6379 5.16138 12.3662 5.49609 12.3662C5.83072 12.3663 6.10156 12.638 6.10156 12.9727V13.3408C6.10179 13.674 6.37282 13.9443 6.70605 13.9443C7.03907 13.9441 7.30935 13.6738 7.30957 13.3408V9.58008L4.36914 9.58105L2.06055 9.58008C1.7259 9.58005 1.45418 9.30924 1.4541 8.97461V8.36914L1.45605 8.36816L1.45703 8.36719C1.45546 8.33164 1.4541 8.2957 1.4541 8.25977C1.45411 8.13978 1.46339 8.02149 1.48047 7.90625C1.79363 5.05332 4.24465 2.78958 7.31738 2.52734V1.75781C7.31738 1.59045 7.45276 1.4541 7.62012 1.4541H8.22656ZM7.91504 3.71387C5.12242 3.71397 2.9445 5.67861 2.68555 8.03906L2.67969 8.08398C2.6713 8.14058 2.667 8.19946 2.66699 8.25977C2.66699 8.32128 2.71876 8.36816 2.78027 8.36816H13.0498C13.1113 8.36816 13.1641 8.32128 13.1641 8.25977V8.24023C13.1632 8.18714 13.1588 8.13515 13.1514 8.08496L13.1475 8.06152L13.1455 8.03906C12.8867 5.67841 10.7079 3.71387 7.91504 3.71387Z"/></svg>;
}

const IconProtection = React.forwardRef(IconProtectionComponent);
export default IconProtection;
