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

function IconKnowledgeBaseComponent(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-KnowledgeBase${loadingKls} ${className}`} width={width} height={height} xmlns="http://www.w3.org/2000/svg" fill={useCurrentColor ? 'currentColor' : '#000'} viewBox="0 0 20 20" {...rest} ref={ref}><path fillRule="evenodd" d="M4.158 3.333h11.684c.464 0 .84.373.84.834v13.346a.84.84 0 0 1-1.157.772l-5.32-2.324a.847.847 0 0 0-.644.004l-5.076 2.3a.84.84 0 0 1-1.167-.768V4.167c0-.46.376-.834.84-.834ZM7.9 8.342a.418.418 0 0 0-.42.416v.834c0 .23.188.416.42.416h4.2c.233 0 .42-.186.42-.416v-.834a.418.418 0 0 0-.42-.416H7.9Z" clipRule="evenodd"/><path d="M2.083 6.333v-4c0-.368.299-.666.667-.666h14.5c.368 0 .667.298.667.666v4A.667.667 0 0 1 17.25 7h-.568V4.167a.837.837 0 0 0-.84-.834H4.158a.837.837 0 0 0-.84.834V7H2.75a.667.667 0 0 1-.667-.667Z" opacity=".5"/></svg>;
}

const IconKnowledgeBase = React.forwardRef(IconKnowledgeBaseComponent);
export default IconKnowledgeBase;
