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

function IconConfigComponent(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-config${loadingKls} ${className}`} width={width} height={height} xmlns="http://www.w3.org/2000/svg" fill={useCurrentColor ? 'currentColor' : '#000'} viewBox="0 0 24 24" {...rest} ref={ref}><path fillRule="evenodd" d="M16.286 13.42a1.26 1.26 0 0 0-.647-.134h-.677a1.269 1.269 0 0 0-.646.133 1.03 1.03 0 0 0-.425.426c-.101.2-.147.422-.134.646v1.623H3.177a1.268 1.268 0 0 0-.647.134 1.03 1.03 0 0 0-.425.425c-.1.2-.147.422-.134.645v.679c0 .257.028.445.134.644.096.181.244.33.425.425.2.101.423.147.647.134h10.58v1.625c0 .257.028.446.134.645.096.18.244.329.425.425.2.1.423.147.646.134h.677c.258 0 .446-.028.645-.134a1.03 1.03 0 0 0 .425-.425c.1-.2.147-.422.134-.645V19.2h3.982c.257 0 .446-.027.645-.134a1.03 1.03 0 0 0 .425-.425c.1-.2.147-.423.134-.646v-.677c0-.257-.028-.446-.134-.645a1.028 1.028 0 0 0-.425-.425c-.2-.1-.422-.147-.645-.134h-3.982v-1.623a1.268 1.268 0 0 0-.134-.646 1.028 1.028 0 0 0-.425-.426h.002Zm-6.6-11.315a1.267 1.267 0 0 0-.648-.134h-.676a1.269 1.269 0 0 0-.646.134 1.03 1.03 0 0 0-.425.425c-.101.2-.147.423-.134.647V4.8h-3.98a1.269 1.269 0 0 0-.647.134 1.03 1.03 0 0 0-.425.425c-.1.2-.147.423-.134.646v.676a1.27 1.27 0 0 0 .134.646c.096.18.244.329.425.425.2.1.423.147.647.134h3.98v1.623c-.013.224.033.447.134.646.096.181.244.33.425.426.2.1.423.147.646.133h.676c.223.013.446-.033.646-.133.18-.097.329-.245.425-.426.101-.2.147-.422.134-.646V7.886h10.582c.257 0 .446-.028.645-.134a1.03 1.03 0 0 0 .425-.425c.1-.2.147-.423.134-.646v-.676a1.268 1.268 0 0 0-.134-.646 1.028 1.028 0 0 0-.425-.425c-.2-.1-.422-.147-.645-.134H10.243V3.177a1.268 1.268 0 0 0-.134-.647 1.024 1.024 0 0 0-.423-.425Z" clipRule="evenodd"/></svg>;
}

const IconConfig = React.forwardRef(IconConfigComponent);
export default IconConfig;
