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

function IconTimerComponent(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-timer${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' : '#00CDD8'} d="M18 0H6a6 6 0 0 0-6 6v12a6 6 0 0 0 6 6h12a6 6 0 0 0 6-6V6a6 6 0 0 0-6-6Z"/><path fill={useCurrentColor ? 'currentColor' : '#fff'} fillRule="evenodd" d="M4.7 5.802V16.53a1.5 1.5 0 0 0 2.211 1.321l1.25-.673a7.003 7.003 0 0 1 4.375-9.666L6.912 4.48A1.5 1.5 0 0 0 4.7 5.802Z" clipRule="evenodd" opacity=".7"/><path fill={useCurrentColor ? 'currentColor' : '#fff'} fillRule="evenodd" d="M14.512 8.728a5.5 5.5 0 1 0 0 11 5.5 5.5 0 0 0 0-11Zm.67 3.063a.733.733 0 1 0-1.468 0v2.292c0 .32.128.628.354.855l1.604 1.604a.733.733 0 1 0 1.037-1.038l-1.528-1.527V11.79Z" clipRule="evenodd"/></g></svg>;
}

const IconTimer = React.forwardRef(IconTimerComponent);
export default IconTimer;
