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

function IconDistributionComponent(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-distribution${loadingKls} ${className}`} width={width} height={height} viewBox="0 0 32 32" fill={useCurrentColor ? 'currentColor' : '#000'} xmlns="http://www.w3.org/2000/svg" {...rest} ref={ref}><path opacity=".4" fillRule="evenodd" clipRule="evenodd" d="M6.23444 18.667H4.66675C3.56218 18.667 2.66675 19.5624 2.66675 20.667V27.3337C2.66675 28.4382 3.56218 29.3337 4.66675 29.3337H27.3334C28.438 29.3337 29.3334 28.4382 29.3334 27.3337V20.667C29.3334 19.5624 28.438 18.667 27.3334 18.667H25.7657V23.3337C25.7657 24.4382 24.8703 25.3337 23.7657 25.3337H8.23444C7.12987 25.3337 6.23444 24.4382 6.23444 23.3337V18.667Z"/><path fillRule="evenodd" clipRule="evenodd" d="M8.23438 2.66699C7.12981 2.66699 6.23438 3.56242 6.23438 4.66699V23.3337C6.23438 24.4382 7.12981 25.3337 8.23438 25.3337H23.7656C24.8702 25.3337 25.7656 24.4382 25.7656 23.3337V4.66699C25.7656 3.56242 24.8702 2.66699 23.7656 2.66699H8.23438ZM15.2204 7.70003C15.2204 8.70473 14.5578 9.55467 13.6457 9.83672V11.0668C14.3998 11.2143 15.0524 11.6454 15.4878 12.2444L17.4782 11.0953C17.4584 10.9756 17.4481 10.8527 17.4481 10.7274C17.4481 9.49237 18.4492 8.49121 19.6842 8.49121C20.9192 8.49121 21.9204 9.49237 21.9204 10.7274C21.9204 11.9624 20.9192 12.9635 19.6842 12.9635C19.0556 12.9635 18.4876 12.7042 18.0814 12.2866L16.0127 13.481C16.0422 13.6496 16.0576 13.8231 16.0576 14.0002C16.0576 14.0822 16.0543 14.1634 16.0478 14.2438L18.0889 15.4222C18.4946 15.0091 19.0595 14.7529 19.6842 14.7529C20.9192 14.7529 21.9204 15.7541 21.9204 16.9891C21.9204 18.2241 20.9192 19.2252 19.6842 19.2252C18.4492 19.2252 17.4481 18.2241 17.4481 16.9891C17.4481 16.86 17.459 16.7334 17.48 16.6102L15.6298 15.542C15.2016 16.2517 14.4868 16.769 13.6457 16.9335V18.1637C14.5578 18.4457 15.2204 19.2957 15.2204 20.3004C15.2204 21.5354 14.2192 22.5365 12.9842 22.5365C11.7492 22.5365 10.7481 21.5354 10.7481 20.3004C10.7481 19.2995 11.4057 18.4521 12.3124 18.1669V16.8927C11.0278 16.5578 10.0796 15.3897 10.0796 14.0002C10.0796 12.6106 11.0278 11.4425 12.3124 11.1076V9.83351C11.4057 9.54826 10.7481 8.70094 10.7481 7.70003C10.7481 6.46503 11.7492 5.46387 12.9842 5.46387C14.2192 5.46387 15.2204 6.46503 15.2204 7.70003Z"/></svg>;
}

const IconDistribution = React.forwardRef(IconDistributionComponent);
export default IconDistribution;
