// apps/web/src/components/editor/common/loading-overlay.tsx import { X } from "lucide-react"; import { cn } from "@/lib/utils"; import { useEditorStore } from "@/stores/editor-store"; export function LoadingOverlay() { const loadingState = useEditorStore((s) => s.loadingState); const setLoadingState = useEditorStore((s) => s.setLoadingState); if (!loadingState) return null; return (
{/* Operation name */}

{loadingState.operation}

{/* Progress bar */} {loadingState.progress !== null && (
= 0 ? { width: `${Math.min(100, loadingState.progress)}%` } : undefined } />
)} {/* Indeterminate spinner when no progress */} {loadingState.progress === null && (
)} {/* Cancel button */} {loadingState.cancellable && ( )}
); }