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

function IconAnnotationComponent(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-annotation${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="M15.1 2.08a3.15 3.15 0 0 1 3.15 3.15v7.628l-.004.162a3.151 3.151 0 0 1-3.146 2.99h-2.696a.25.25 0 0 0-.14.042l-.037.032-1.595 1.608a.75.75 0 0 1-.954.092l-.115-.096-1.568-1.603a.25.25 0 0 0-.179-.075H4.9a3.15 3.15 0 0 1-3.15-3.15V5.23A3.15 3.15 0 0 1 4.9 2.08h10.2ZM4.9 3.58c-.91 0-1.65.74-1.65 1.65v7.628c0 .912.74 1.65 1.65 1.65h3.326l.088.005a.75.75 0 0 1 .46.221l1.15 1.178a.25.25 0 0 0 .357.001l1.164-1.173.07-.064a.751.751 0 0 1 .473-.167H15.1c.91 0 1.65-.74 1.65-1.65V5.23c0-.91-.74-1.65-1.65-1.65H4.9Zm7.6 4.67a.75.75 0 0 1 0 1.5h-5a.75.75 0 0 1 0-1.5h5Z"/></svg>;
}

const IconAnnotation = React.forwardRef(IconAnnotationComponent);
export default IconAnnotation;
