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

function IconOutputComponent(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-output${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="M12.5231 3.14638C12.1752 2.77771 11.6383 3.15804 11.7366 3.70288L12.3975 7.37787L6.3037 8.12046V11.8795L12.3975 12.622L11.7366 16.297C11.6383 16.8424 12.1752 17.2222 12.5231 16.8535L18.1739 10.8685C18.6087 10.4077 18.6087 9.5922 18.1739 9.13137L12.5231 3.14638ZM5.3435 8.26454V11.7354L3.90157 11.5184V8.48154L5.3435 8.26454ZM1.5 11.1567L2.94138 11.3737V8.6262L1.5 8.8432V11.1567Z"/></svg>;
}

const IconOutput = React.forwardRef(IconOutputComponent);
export default IconOutput;
