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

function IconMoonComponent(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 || 'hkgai';
    const loadingKls = spin ? ` ${prefix}-icon-loading` : '';
    return <svg className={`${prefix}-icon ${prefix}-icon-Moon${loadingKls} ${className}`} width={width} height={height} viewBox="0 0 24 24" fill={useCurrentColor ? 'currentColor' : '#000'} xmlns="http://www.w3.org/2000/svg" {...rest} ref={ref}><path d="M22.1594 13.0691C22.0151 12.9245 21.8342 12.8219 21.636 12.7724C21.4378 12.7228 21.2298 12.7282 21.0344 12.7879C19.6695 13.1999 18.2184 13.234 16.8357 12.8865C15.453 12.539 14.1904 11.823 13.1824 10.8147C12.1745 9.80634 11.4589 8.54348 11.112 7.16061C10.765 5.77774 10.7997 4.32666 11.2122 2.96193C11.2724 2.76646 11.2782 2.55828 11.2289 2.35979C11.1796 2.16129 11.0772 1.97998 10.9326 1.83536C10.7879 1.69074 10.6066 1.58829 10.4081 1.53901C10.2096 1.48973 10.0015 1.49549 9.80599 1.55568C7.75324 2.18661 5.95183 3.44901 4.65818 5.16318C3.5269 6.66683 2.83703 8.45598 2.66596 10.3299C2.49489 12.2038 2.8494 14.0883 3.68971 15.7719C4.53002 17.4555 5.82288 18.8717 7.42322 19.8615C9.02356 20.8513 10.8681 21.3755 12.7497 21.3754C14.9466 21.3818 17.085 20.6675 18.8369 19.3419C20.5502 18.047 21.8113 16.2446 22.4407 14.1913C22.4998 13.9963 22.5049 13.7889 22.4554 13.5913C22.4058 13.3936 22.3035 13.2132 22.1594 13.0691ZM17.4832 17.5447C15.9668 18.6863 14.0891 19.2418 12.1957 19.1089C10.3023 18.9761 8.52054 18.1638 7.1784 16.8217C5.83627 15.4796 5.02403 13.6978 4.89118 11.8044C4.75833 9.91102 5.3138 8.03333 6.45537 6.51693C7.05606 5.72236 7.8005 5.04756 8.65006 4.52755C8.63318 4.76755 8.62475 5.00849 8.62475 5.25036C8.62772 7.93477 9.69542 10.5084 11.5936 12.4065C13.4917 14.3047 16.0653 15.3724 18.7497 15.3754C18.9916 15.3754 19.2326 15.3669 19.4726 15.35C18.9528 16.1998 18.278 16.9443 17.4832 17.5447Z"/></svg>;
}

const IconMoon = React.forwardRef(IconMoonComponent);
export default IconMoon;
