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

function IconText2speechComponent(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-text2speech${loadingKls} ${className}`} width={width} height={height} viewBox="0 0 22 22" fill={useCurrentColor ? 'currentColor' : '#000'} xmlns="http://www.w3.org/2000/svg" {...rest} ref={ref}><path d="M17.5967 4C18.4451 4 19.1336 4.68771 19.1338 5.53613V17.5967C19.1338 18.4453 18.4453 19.1338 17.5967 19.1338H5.53613C4.68773 19.1336 4 18.4451 4 17.5967V13.8682C4 13.592 4.22386 13.3682 4.5 13.3682H5.03613C5.31227 13.3682 5.53613 13.592 5.53613 13.8682V17.5967H17.5967V5.53613H10.2988C10.0867 5.53613 9.91406 5.36449 9.91406 5.15234V4.38379C9.91425 4.1718 10.0868 4 10.2988 4H17.5967ZM13.2705 7.90039C13.4359 7.9007 13.5703 8.03567 13.5703 8.20117V15.6006C13.5701 15.7659 13.4358 15.9001 13.2705 15.9004H12.3701C12.2046 15.9003 12.0705 15.766 12.0703 15.6006V8.20117C12.0703 8.03555 12.2045 7.9005 12.3701 7.90039H13.2705ZM10.7705 9.30078C10.9359 9.30108 11.0702 9.43518 11.0703 9.60059V13.6006C11.0701 13.7659 10.9358 13.9001 10.7705 13.9004H9.87012C9.70464 13.9003 9.57051 13.766 9.57031 13.6006V9.60059C9.57042 9.43506 9.70459 9.30089 9.87012 9.30078H10.7705ZM15.7705 10.0508C15.9359 10.0511 16.0702 10.1852 16.0703 10.3506V12.751C16.07 12.9162 15.9357 13.0505 15.7705 13.0508H14.8701C14.7047 13.0507 14.5706 12.9163 14.5703 12.751V10.3506C14.5704 10.1851 14.7046 10.0509 14.8701 10.0508H15.7705ZM8.27051 10.3008C8.43587 10.3011 8.57021 10.4352 8.57031 10.6006V12.001C8.57001 12.1662 8.43575 12.3005 8.27051 12.3008H7.37012C7.20471 12.3007 7.07062 12.1663 7.07031 12.001V10.6006C7.07042 10.4351 7.20459 10.3009 7.37012 10.3008H8.27051ZM7.5752 4C7.75459 4.00011 7.90039 4.15147 7.90039 4.33789L7.90527 5.16211C7.90527 5.34858 7.75956 5.49998 7.58008 5.5L5.50488 5.51367L5.5 11.1045C5.49995 11.2909 5.35427 11.4424 5.1748 11.4424L4.3252 11.4287C4.1457 11.4287 4 11.2773 4 11.0908L4.00488 5.5H2C1.82051 5.5 1.6748 5.3486 1.6748 5.16211L1.66992 4.33789C1.66992 4.1514 1.81562 4 1.99512 4H7.5752Z"/></svg>;
}

const IconText2speech = React.forwardRef(IconText2speechComponent);
export default IconText2speech;
