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

function IconOptimalLayoutComponent(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-optimal-layout${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="M13.92 21.84a1.2 1.2 0 0 1-1.2-1.2v-6.72a1.2 1.2 0 0 1 1.2-1.2h6.72a1.2 1.2 0 0 1 1.2 1.2v6.72a1.2 1.2 0 0 1-1.2 1.2h-6.72Zm0-10.56a1.2 1.2 0 0 1-1.2-1.2V3.36a1.2 1.2 0 0 1 1.2-1.2h6.72a1.2 1.2 0 0 1 1.2 1.2v6.72a1.2 1.2 0 0 1-1.2 1.2h-6.72Zm-10.56 0a1.2 1.2 0 0 1-1.2-1.2V3.36a1.2 1.2 0 0 1 1.2-1.2h6.72a1.2 1.2 0 0 1 1.2 1.2v6.72a1.2 1.2 0 0 1-1.2 1.2H3.36Zm16.08-2.4V4.56h-4.32v4.32h4.32Zm-10.56 0V4.56H4.56v4.32h4.32ZM3.36 21.84a1.2 1.2 0 0 1-1.2-1.2v-6.72a1.2 1.2 0 0 1 1.2-1.2h6.72a1.2 1.2 0 0 1 1.2 1.2v6.72a1.2 1.2 0 0 1-1.2 1.2H3.36Zm11.76-2.4h4.32v-4.32h-4.32v4.32Zm-10.56 0h4.32v-4.32H4.56v4.32Z" clipRule="evenodd"/></svg>;
}

const IconOptimalLayout = React.forwardRef(IconOptimalLayoutComponent);
export default IconOptimalLayout;
