import { jsx as _jsx } from "@emotion/react/jsx-runtime";
import { useState, useEffect, } from 'react';
import { LoadingOutlined } from '@ant-design/icons';
import { Spin } from 'antd';
import { SpinCSS } from './update-indicator.style';
export const UpdateIndicator = () => {
    const [isLoading, setIsLoading] = useState(false);
    useEffect(() => {
        const handleBuildStart = () => setIsLoading(true);
        const handleBuildEnd = () => setIsLoading(false);
        const unsubscribeBuildStart = window.electron.onExtensionBuildStart(handleBuildStart);
        const unsubscribeBuildEnd = window.electron.onExtensionBuildEnd(handleBuildEnd);
        return () => {
            unsubscribeBuildStart();
            unsubscribeBuildEnd();
        };
    }, []);
    if (!isLoading) {
        return null;
    }
    return (_jsx(Spin, { css: SpinCSS, indicator: _jsx(LoadingOutlined, { spin: true }), size: "small" }));
};
