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

function IconMessageComponent(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-message${loadingKls} ${className}`} width={width} height={height} xmlns="http://www.w3.org/2000/svg" fill={useCurrentColor ? 'currentColor' : '#000'} viewBox="0 0 48 48" {...rest} ref={ref}><path d="M39 24c0-8.284-6.716-15-15-15-8.284 0-15 6.716-15 15v15h15.63C32.566 39 39 32.566 39 24.63V24Zm-15 3v4h-9v-4h9Zm9-9v4H15v-4h18Zm10 6.63C43 34.775 34.775 43 24.63 43H5V24C5 13.507 13.507 5 24 5s19 8.507 19 19v.63Z"/></svg>;
}

const IconMessage = React.forwardRef(IconMessageComponent);
export default IconMessage;
