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

function IconTxtSmallColorComponent(props: OriginIconProps, ref: ForwardedRef<SVGSVGElement>) {
    const { prefix: prefixFromContext } = useContext(Context);
    const { className = '', prefix: prefixFromProps, width = '1em', height = '1em', useCurrentColor = false, spin, ...rest } = props;

    const prefix = prefixFromProps || prefixFromContext || 'font';
    const loadingKls = spin ? ` ${prefix}-icon-loading` : '';
    return <svg className={`${prefix}-icon ${prefix}-icon-txt_small_color${loadingKls} ${className}`} width={width} height={height} viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" {...rest} ref={ref}><rect width="20" height="20" rx="5" fill={useCurrentColor ? 'currentColor' : '#8CA9E0'} fillOpacity=".2"/><rect x="3.76" y="5" width="12" height="2" rx="1" fill={useCurrentColor ? 'currentColor' : '#8CA9E0'}/><rect x="3.76" y="9" width="12" height="2" rx="1" fill={useCurrentColor ? 'currentColor' : '#8CA9E0'}/><rect x="3.76" y="13" width="6" height="2" rx="1" fill={useCurrentColor ? 'currentColor' : '#8CA9E0'}/></svg>;
}

const IconTxtSmallColor = React.forwardRef(IconTxtSmallColorComponent);
export default IconTxtSmallColor;
