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

function IconBreakComponent(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 || 'hiagent';
    const loadingKls = spin ? ` ${prefix}-icon-loading` : '';
    return <svg className={`${prefix}-icon ${prefix}-icon-break${loadingKls} ${className}`} width={width} height={height} xmlns="http://www.w3.org/2000/svg" fill={useCurrentColor ? 'currentColor' : 'none'} viewBox="0 0 24 24" {...rest} ref={ref}><g><path fill={useCurrentColor ? 'currentColor' : '#28CAC8'} d="M16.8 0H7.2A7.2 7.2 0 0 0 0 7.2v9.6A7.2 7.2 0 0 0 7.2 24h9.6a7.2 7.2 0 0 0 7.2-7.2V7.2A7.2 7.2 0 0 0 16.8 0Z"/><path fill={useCurrentColor ? 'currentColor' : '#fff'} fillRule="evenodd" d="M12 4.3a7.7 7.7 0 1 1 0 15.4 7.7 7.7 0 0 1 0-15.4Zm2.17 4.55a.98.98 0 0 1 .98.98v4.34a.98.98 0 0 1-.98.98H9.83a.98.98 0 0 1-.98-.98V9.83a.98.98 0 0 1 .98-.98h4.34Z" clipRule="evenodd"/></g></svg>;
}

const IconBreak = React.forwardRef(IconBreakComponent);
export default IconBreak;
