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

function IconDeleteComponent(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-delete${loadingKls} ${className}`} width={width} height={height} xmlns="http://www.w3.org/2000/svg" fill={useCurrentColor ? 'currentColor' : '#000'} viewBox="0 0 16 16" {...rest} ref={ref}><path fillRule="evenodd" d="M13 5.5H3l.395 7.11a2 2 0 0 0 1.997 1.89h5.216a2 2 0 0 0 1.997-1.89L13 5.5Zm-5.975 2c.18 0 .325.14.325.313v4.375a.319.319 0 0 1-.325.312h-.65a.319.319 0 0 1-.325-.313V7.814a.32.32 0 0 1 .325-.313h.65Zm2.6 0c.18 0 .325.14.325.313v4.375a.319.319 0 0 1-.325.312h-.65a.319.319 0 0 1-.325-.313V7.814a.32.32 0 0 1 .325-.313h.65Z" clipRule="evenodd"/><path d="M1.5 4.35C1.5 3.604 2.104 3 2.85 3h10.3c.746 0 1.35.604 1.35 1.35a.45.45 0 0 1-.45.45H1.95a.45.45 0 0 1-.45-.45Z"/><path d="M5 2.5a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v1H5v-1Z"/></svg>;
}

const IconDelete = React.forwardRef(IconDeleteComponent);
export default IconDelete;
