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

function IconAttachmentComponent(props: OriginIconProps, ref: ForwardedRef<SVGSVGElement>) {
    const { prefix: prefixFromContext } = useContext(Context);
    const { className = '', prefix: prefixFromProps, width = '1em', height = '1em', useCurrentColor = false, spin, ...rest } = props;

    const prefix = prefixFromProps || prefixFromContext || 'hkgai';
    const loadingKls = spin ? ` ${prefix}-icon-loading` : '';
    return <svg className={`${prefix}-icon ${prefix}-icon-attachment${loadingKls} ${className}`} width={width} height={height} viewBox="0 0 70 70" fill="none" xmlns="http://www.w3.org/2000/svg" {...rest} ref={ref}><rect width="70" height="70" rx="8" fill={useCurrentColor ? 'currentColor' : '#D9D9D9'}/><rect width="70" height="70" rx="8" fill={useCurrentColor ? 'currentColor' : '#F6F5F5'}/><rect x=".5" y=".5" width="69" height="69" rx="7.5" stroke="#000" strokeOpacity=".2"/><rect x="10" y="15" width="50" height="4" rx="2" fill={useCurrentColor ? 'currentColor' : '#D9D9D9'}/><rect x="10" y="24" width="50" height="4" rx="2" fill={useCurrentColor ? 'currentColor' : '#D9D9D9'}/><rect x="10" y="33" width="50" height="4" rx="2" fill={useCurrentColor ? 'currentColor' : '#D9D9D9'}/><rect x="10" y="42" width="50" height="4" rx="2" fill={useCurrentColor ? 'currentColor' : '#D9D9D9'}/><rect x="10" y="51" width="35" height="4" rx="2" fill={useCurrentColor ? 'currentColor' : '#D9D9D9'}/></svg>;
}

const IconAttachment = React.forwardRef(IconAttachmentComponent);
export default IconAttachment;
