summaryrefslogtreecommitdiff
path: root/apps/web/src/components/editor-provider.tsx
diff options
context:
space:
mode:
authorMaze Winther <mazewinther@gmail.com>2025-08-27 00:52:39 +0200
committerMaze Winther <mazewinther@gmail.com>2025-08-27 00:52:39 +0200
commitadc8cb37fcec21afac848b1e5dd724394c344050 (patch)
tree9157bc1973840b00a96912d42f6741352abedbc4 /apps/web/src/components/editor-provider.tsx
parentb459b46802a760a4a81ce91fdf24390e07375fb0 (diff)
downloadopencut-adc8cb37fcec21afac848b1e5dd724394c344050.tar.gz
another huge refactor
Diffstat (limited to 'apps/web/src/components/editor-provider.tsx')
-rw-r--r--apps/web/src/components/editor-provider.tsx53
1 files changed, 0 insertions, 53 deletions
diff --git a/apps/web/src/components/editor-provider.tsx b/apps/web/src/components/editor-provider.tsx
deleted file mode 100644
index b8e9ae1d..00000000
--- a/apps/web/src/components/editor-provider.tsx
+++ /dev/null
@@ -1,53 +0,0 @@
-"use client";
-
-import { useEffect } from "react";
-import { Loader2 } from "lucide-react";
-import { useEditorStore } from "@/stores/editor-store";
-import {
- useKeybindingsListener,
- useKeybindingDisabler,
-} from "@/hooks/use-keybindings";
-import { useEditorActions } from "@/hooks/use-editor-actions";
-
-interface EditorProviderProps {
- children: React.ReactNode;
-}
-
-export function EditorProvider({ children }: EditorProviderProps) {
- const { isInitializing, isPanelsReady, initializeApp } = useEditorStore();
- const { disableKeybindings, enableKeybindings } = useKeybindingDisabler();
-
- // Set up action handlers
- useEditorActions();
-
- // Set up keybinding listener
- useKeybindingsListener();
-
- // Disable keybindings when initializing
- useEffect(() => {
- if (isInitializing || !isPanelsReady) {
- disableKeybindings();
- } else {
- enableKeybindings();
- }
- }, [isInitializing, isPanelsReady, disableKeybindings, enableKeybindings]);
-
- useEffect(() => {
- initializeApp();
- }, [initializeApp]);
-
- // Show loading screen while initializing
- if (isInitializing || !isPanelsReady) {
- return (
- <div className="h-screen w-screen flex items-center justify-center bg-background">
- <div className="flex flex-col items-center gap-4">
- <Loader2 className="h-8 w-8 animate-spin text-muted-foreground" />
- <p className="text-sm text-muted-foreground">Loading editor...</p>
- </div>
- </div>
- );
- }
-
- // App is ready, render children
- return <>{children}</>;
-}