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

function IconDiamondComponent(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-Diamond${loadingKls} ${className}`} width={width} height={height} xmlns="http://www.w3.org/2000/svg" fill={useCurrentColor ? 'currentColor' : '#000'} viewBox="0 0 14 14" {...rest} ref={ref}><path fillRule="evenodd" d="M3.087 2.679a1.05 1.05 0 0 1 .907-.52h6.012c.373 0 .718.197.907.52l1.53 2.617a1.05 1.05 0 0 1-.113 1.217l-4.536 5.241a1.05 1.05 0 0 1-1.588 0L1.67 6.513a1.05 1.05 0 0 1-.112-1.217l1.53-2.617Zm3.048.413H4.246l.676 1.844 1.213-1.844ZM4.107 5.425 3.512 3.8l-.949 1.624h1.544Zm-1.336.933 2.912 3.366L4.45 6.358H2.77Zm2.673 0 1.446 3.946a.11.11 0 0 0 .042.058c.017.01.04.018.068.018.027 0 .05-.007.067-.018a.109.109 0 0 0 .042-.058l1.447-3.946H5.444Zm4.106 0L8.316 9.725l2.913-3.367H9.55Zm1.887-.933-.949-1.623-.595 1.623h1.544Zm-2.359-.49L7.866 3.093h1.888l-.676 1.844Zm-.795.49L7 3.475l-1.283 1.95h2.565Z" clipRule="evenodd"/></svg>;
}

const IconDiamond = React.forwardRef(IconDiamondComponent);
export default IconDiamond;
