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

function IconCloseButtonComponent(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 || 'hkgai';
    const loadingKls = spin ? ` ${prefix}-icon-loading` : '';
    return <svg className={`${prefix}-icon ${prefix}-icon-CloseButton${loadingKls} ${className}`} width={width} height={height} viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg" {...rest} ref={ref}><path d="M16.4644 15.5805C16.2203 15.3365 15.8246 15.3365 15.5805 15.5805C15.3364 15.8246 15.3364 16.2204 15.5805 16.4644L19.1161 20L15.5806 23.5355C15.3365 23.7796 15.3365 24.1753 15.5806 24.4194C15.8246 24.6635 16.2204 24.6635 16.4644 24.4194L20 20.8839L23.5355 24.4194C23.7795 24.6635 24.1753 24.6635 24.4194 24.4194C24.6634 24.1753 24.6634 23.7796 24.4194 23.5355L20.8838 20L24.4194 16.4644C24.6635 16.2204 24.6635 15.8246 24.4194 15.5806C24.1753 15.3365 23.7796 15.3365 23.5355 15.5806L20 19.1161L16.4644 15.5805Z" fill={useCurrentColor ? 'currentColor' : '#1C1C1C'}/></svg>;
}

const IconCloseButton = React.forwardRef(IconCloseButtonComponent);
export default IconCloseButton;
