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

function IconTreeObjectComponent(props: OriginIconProps, ref: ForwardedRef<SVGSVGElement>) {
    const { prefix: prefixFromContext } = useContext(Context);
    const { className = '', prefix: prefixFromProps, width = '1em', height = '1em', useCurrentColor = false, spin, ...rest } = props;

    const prefix = prefixFromProps || prefixFromContext || 'hiagent';
    const loadingKls = spin ? ` ${prefix}-icon-loading` : '';
    return <svg className={`${prefix}-icon ${prefix}-icon-tree_object${loadingKls} ${className}`} width={width} height={height} xmlns="http://www.w3.org/2000/svg" fill={useCurrentColor ? 'currentColor' : 'none'} viewBox="0 0 22 22" {...rest} ref={ref}><rect width="22" height="22" fill={useCurrentColor ? 'currentColor' : '#48B8E8'} rx="6"/><path fill={useCurrentColor ? 'currentColor' : '#fff'} fillRule="evenodd" d="M5 7.173C5 5.973 5.996 5 7.225 5h7.55C16.004 5 17 5.973 17 7.173v7.654c0 1.2-.996 2.173-2.225 2.173h-7.55C5.996 17 5 16.027 5 14.827V7.173Zm1.808 1.258a.603.603 0 0 0 0 .863.633.633 0 0 0 .442.18h2.5a.638.638 0 0 0 .442-.18.609.609 0 0 0 .183-.431.599.599 0 0 0-.183-.432.625.625 0 0 0-.442-.179h-2.5a.633.633 0 0 0-.442.179Zm0 4.274a.603.603 0 0 0 0 .863.633.633 0 0 0 .442.179h2.5a.64.64 0 0 0 .442-.179.609.609 0 0 0 .183-.432.598.598 0 0 0-.183-.431.626.626 0 0 0-.442-.18h-2.5a.633.633 0 0 0-.442.18Zm8.384-5.495a.603.603 0 0 1 0 .863l-1.875 1.832a.633.633 0 0 1-.884 0l-.938-.916a.603.603 0 0 1 .008-.856.632.632 0 0 1 .876-.007l.496.484 1.433-1.4a.632.632 0 0 1 .884 0Zm-1.931 5.362a.64.64 0 0 1 .68.133.604.604 0 0 1 0 .863.633.633 0 0 1-1.019-.198.598.598 0 0 1 .136-.665.627.627 0 0 1 .203-.133Zm-1.087-.73a1.81 1.81 0 0 0-.55 1.294c0 .486.198.952.55 1.296.352.343.829.536 1.326.536.497 0 .974-.193 1.326-.537.351-.343.549-.809.549-1.295a1.81 1.81 0 0 0-.55-1.295 1.898 1.898 0 0 0-1.325-.536c-.497 0-.974.193-1.326.536Z" clipRule="evenodd"/></svg>;
}

const IconTreeObject = React.forwardRef(IconTreeObjectComponent);
export default IconTreeObject;
