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

function IconTextAltComponent(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-text-alt${loadingKls} ${className}`} width={width} height={height} viewBox="0 0 48 48" fill={useCurrentColor ? 'currentColor' : '#000'} xmlns="http://www.w3.org/2000/svg" {...rest} ref={ref}><path fillRule="evenodd" clipRule="evenodd" d="M28 7a1 1 0 00-1-1H5a1 1 0 00-1 1v2a1 1 0 001 1h9v31a1 1 0 001 1h2a1 1 0 001-1V10h9a1 1 0 001-1V7zm16 14a1 1 0 00-1-1H25a1 1 0 00-1 1v2a1 1 0 001 1h7v17a1 1 0 001 1h2a1 1 0 001-1V24h7a1 1 0 001-1v-2z"/></svg>;
}

const IconTextAlt = React.forwardRef(IconTextAltComponent);
export default IconTextAlt;
