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

function IconHierarchyComponent(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-hierarchy${loadingKls} ${className}`} width={width} height={height} viewBox="0 0 48 48" fill={useCurrentColor ? 'currentColor' : '#000'} xmlns="http://www.w3.org/2000/svg" {...rest} ref={ref}><path fillRule="evenodd" clipRule="evenodd" d="M32 9a8 8 0 10-10 7.748V23H10a3 3 0 00-3 3v6.29a7 7 0 104.001 0L11 27h26v5.29a7 7 0 104.001 0L41 26a3 3 0 00-3-3H26v-6.252c3.45-.888 6-4.02 6-7.748zm4 30a3 3 0 116 0 3 3 0 01-6 0zM9 36a3 3 0 100 6 3 3 0 000-6zM20 9a4 4 0 118 0 4 4 0 01-8 0z"/></svg>;
}

const IconHierarchy = React.forwardRef(IconHierarchyComponent);
export default IconHierarchy;
