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

function IconArrangeComponent(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-arrange${loadingKls} ${className}`} width={width} height={height} xmlns="http://www.w3.org/2000/svg" fill={useCurrentColor ? 'currentColor' : '#000'} viewBox="0 0 20 20" {...rest} ref={ref}><path d="M7.681 2.083 2.083 7.681V2.963a.88.88 0 0 1 .88-.88H7.68Z" opacity=".5"/><path fillRule="evenodd" d="M2.083 7.681v9.356c0 .486.394.88.88.88h14.074a.88.88 0 0 0 .88-.88V2.963a.88.88 0 0 0-.88-.88H7.681L2.083 7.681Zm7.105 1.667v2.312h-.574a.26.26 0 0 0-.26.26v.573h-1.28v-.315a.518.518 0 0 0-.519-.518H4.258a.518.518 0 0 0-.518.518v2.297c0 .286.232.518.518.518h2.296a.518.518 0 0 0 .519-.518v-.315h1.282v.574c0 .143.116.26.26.26h2.814a.26.26 0 0 0 .26-.26v-.574h1.28v.574c0 .143.117.26.26.26h2.815a.26.26 0 0 0 .259-.26v-2.815a.26.26 0 0 0-.26-.259H13.23a.26.26 0 0 0-.26.26v.573h-1.28v-.574a.26.26 0 0 0-.26-.259h-.574V9.348h1.981a.518.518 0 0 0 .519-.519V6.533a.518.518 0 0 0-.519-.518h-5.63a.518.518 0 0 0-.518.518v2.296c0 .287.232.519.518.519h1.982Z" clipRule="evenodd"/><path d="M9.188 11.66V9.348h1.667v2.312H9.188Zm-.833.833H7.073v-.315a.518.518 0 0 0-.518-.518H4.258a.518.518 0 0 0-.518.518v2.297c0 .286.232.518.518.518h2.297a.519.519 0 0 0 .518-.518v-.315h1.282v-1.667Zm3.333 1.667h1.282v.574c0 .143.116.26.26.26h2.814a.26.26 0 0 0 .26-.26v-2.815a.26.26 0 0 0-.26-.259h-2.815a.26.26 0 0 0-.26.26v.573h-1.28v1.667Z" opacity=".5"/></svg>;
}

const IconArrange = React.forwardRef(IconArrangeComponent);
export default IconArrange;
