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

function IconClosureComponent(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-closure${loadingKls} ${className}`} width={width} height={height} xmlns="http://www.w3.org/2000/svg" fill={useCurrentColor ? 'currentColor' : '#000'} viewBox="0 0 24 24" {...rest} ref={ref}><path fillRule="evenodd" d="M16.808 18.505a1.2 1.2 0 1 0 1.697-1.697L13.697 12l4.808-4.809a1.2 1.2 0 0 0-1.697-1.697L12 10.303 7.19 5.494a1.2 1.2 0 1 0-1.697 1.697L10.303 12l-4.808 4.808a1.2 1.2 0 1 0 1.697 1.697L12 13.697l4.808 4.808Z" clipRule="evenodd"/></svg>;
}

const IconClosure = React.forwardRef(IconClosureComponent);
export default IconClosure;
