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

function IconTpcComponent(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-tpc${loadingKls} ${className}`} width={width} height={height} xmlns="http://www.w3.org/2000/svg" fill={useCurrentColor ? 'currentColor' : '#000'} viewBox="0 0 20 20" {...rest} ref={ref}><path d="M7.681 2.083 2.083 7.681V2.963a.88.88 0 0 1 .88-.88H7.68Z" opacity=".5"/><path fillRule="evenodd" d="M2.083 17.037V7.681l5.598-5.598h9.356a.88.88 0 0 1 .88.88v14.074a.88.88 0 0 1-.88.88H2.963a.88.88 0 0 1-.88-.88ZM12.2 8.021a2.196 2.196 0 0 1-2.199 2.199c-1.217 0-2.2-.982-2.2-2.2 0-1.216.983-2.198 2.2-2.198s2.2.982 2.2 2.199Zm-6.597 5.424c0-1.466 2.932-2.272 4.398-2.272 1.466 0 4.398.806 4.398 2.272v.733H5.602v-.733Z" clipRule="evenodd"/><path fillRule="evenodd" d="M2.083 17.037V7.681l5.598-5.598h9.356a.88.88 0 0 1 .88.88v14.074a.88.88 0 0 1-.88.88H2.963a.88.88 0 0 1-.88-.88ZM12.2 8.021a2.196 2.196 0 0 1-2.199 2.199c-1.217 0-2.2-.982-2.2-2.2 0-1.216.983-2.198 2.2-2.198s2.2.982 2.2 2.199Zm-6.597 5.424c0-1.466 2.932-2.272 4.398-2.272 1.466 0 4.398.806 4.398 2.272v.733H5.602v-.733Z" clipRule="evenodd"/></svg>;
}

const IconTpc = React.forwardRef(IconTpcComponent);
export default IconTpc;
