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

function IconConversationComponent(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-conversation${loadingKls} ${className}`} width={width} height={height} xmlns="http://www.w3.org/2000/svg" fill={useCurrentColor ? 'currentColor' : '#000'} viewBox="0 0 24 24" {...rest} ref={ref}><path fillRule="evenodd" d="M6.357 2.5h13.905c.957 0 1.731.782 1.731 1.739l.008 12.745a.75.75 0 0 1-1.282.531l-1.252-1.252V7.422c0-.901-.738-1.64-1.64-1.64H4.619V4.237c0-.955.784-1.736 1.739-1.736Z" clipRule="evenodd" opacity=".2"/><path fillRule="evenodd" d="M10.734 5.782h7.094c.901 0 1.639.739 1.639 1.64v9.84c0 .9-.738 1.638-1.64 1.638H5.28l-1.998 1.998a.75.75 0 0 1-1.281-.531l.008-12.945c0-.901.729-1.64 1.632-1.64h7.093ZM6 10.252a.25.25 0 0 1 .25-.25h9a.25.25 0 0 1 .251.25v.999a.25.25 0 0 1-.25.25h-9A.25.25 0 0 1 6 11.25v-.999Zm0 3.5a.25.25 0 0 1 .25-.25h5a.25.25 0 0 1 .25.25v1a.25.25 0 0 1-.25.249h-5a.25.25 0 0 1-.25-.249v-1Z" clipRule="evenodd" opacity=".5"/></svg>;
}

const IconConversation = React.forwardRef(IconConversationComponent);
export default IconConversation;
