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 = true, spin, ...rest } = props;

    const prefix = prefixFromProps || prefixFromContext || 'hiagent';
    const loadingKls = spin ? ` ${prefix}-icon-loading` : '';
    return <svg className={`${prefix}-icon ${prefix}-icon-attachment${loadingKls} ${className}`} width={width} height={height} viewBox="0 0 48 48" fill={useCurrentColor ? 'currentColor' : '#000'} xmlns="http://www.w3.org/2000/svg" {...rest} ref={ref}><path d="M27.171 14.358l-12.36 12.36a5.915 5.915 0 008.365 8.365l14.06-14.06c3.838-3.838 3.838-10.062 0-13.9-3.84-3.84-10.063-3.84-13.902 0L8.718 21.737c-5.272 5.272-5.272 13.82 0 19.092 5.272 5.272 13.82 5.272 19.092 0l10.614-10.615a2 2 0 10-2.828-2.828L24.981 38.002a9.5 9.5 0 01-13.435 0 9.5 9.5 0 010-13.435L26.162 9.95a5.83 5.83 0 018.245 8.244l-14.06 14.06a1.915 1.915 0 01-2.708-2.708L30 17.187a2 2 0 00-2.828-2.83z"/></svg>;
}

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