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

function IconPermissionComponent(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-permission${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 fillRule="evenodd" clipRule="evenodd" d="M1.96582 11.5285C1.96582 10.5344 2.77171 9.72852 3.76582 9.72852H13.5158C14.5099 9.72852 15.3158 10.5344 15.3158 11.5285V13.7785C15.3158 14.7726 14.5099 15.5785 13.5158 15.5785H3.76582C2.77171 15.5785 1.96582 14.7726 1.96582 13.7785V11.5285zM3.76582 11.0785C3.51729 11.0785 3.31582 11.28 3.31582 11.5285V13.7785C3.31582 14.027 3.51729 14.2285 3.76582 14.2285H13.5158C13.7643 14.2285 13.9658 14.027 13.9658 13.7785V11.5285C13.9658 11.28 13.7643 11.0785 13.5158 11.0785H3.76582zM3.76582 4.32852C3.51729 4.32852 3.31582 4.52999 3.31582 4.77852V7.02852C3.31582 7.27704 3.51729 7.47852 3.76582 7.47852H7.89082C8.26361 7.47852 8.56582 7.78072 8.56582 8.15352 8.56582 8.52631 8.26361 8.82852 7.89082 8.82852H3.76582C2.77171 8.82852 1.96582 8.02263 1.96582 7.02852V4.77852C1.96582 3.7844 2.77171 2.97852 3.76582 2.97852H7.89082C8.26361 2.97852 8.56582 3.28072 8.56582 3.65352 8.56582 4.02631 8.26361 4.32852 7.89082 4.32852H3.76582zM12.7351 3.77187C11.6581 3.77187 10.7851 4.64492 10.7851 5.72188 10.7851 6.79883 11.6581 7.67188 12.7351 7.67188 13.812 7.67188 14.6851 6.79883 14.6851 5.72188 14.6851 4.64492 13.812 3.77187 12.7351 3.77187zM9.43506 5.72188C9.43506 3.89934 10.9125 2.42188 12.7351 2.42188 14.5576 2.42188 16.0351 3.89934 16.0351 5.72188 16.0351 7.54441 14.5576 9.02188 12.7351 9.02188 10.9125 9.02188 9.43506 7.54441 9.43506 5.72188z"/><path d="M13.8601 5.7218C13.8601 6.34312 13.3564 6.8468 12.7351 6.8468C12.1138 6.8468 11.6101 6.34312 11.6101 5.7218C11.6101 5.10048 12.1138 4.5968 12.7351 4.5968C13.3564 4.5968 13.8601 5.10048 13.8601 5.7218Z"/></svg>;
}

const IconPermission = React.forwardRef(IconPermissionComponent);
export default IconPermission;
