import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
import { DefaultEditorLoader } from "@powerhousedao/design-system/connect";
import { useEffect, useState } from "react";
export function EditorLoader(props) {
    const [showLoading, setShowLoading] = useState(false);
    // only shows the loader after some time has passed
    useEffect(() => {
        setTimeout(() => {
            setShowLoading(true);
        }, props.loadingTimeout ?? 200);
    }, [props]);
    if (!showLoading)
        return null;
    const { customEditorLoader, ...defaultProps } = props;
    if (customEditorLoader)
        return _jsx(_Fragment, { children: customEditorLoader });
    return _jsx(DefaultEditorLoader, { ...defaultProps });
}
//# sourceMappingURL=editor-loader.js.map