diff --git a/src/components/features/playground/workspace/editor/components/format-button.tsx b/src/components/features/playground/workspace/editor/components/format-button.tsx index fc28bd7..5dd2f33 100644 --- a/src/components/features/playground/workspace/editor/components/format-button.tsx +++ b/src/components/features/playground/workspace/editor/components/format-button.tsx @@ -8,10 +8,10 @@ import { } from "@/components/ui/tooltip"; import { Paintbrush } from "lucide-react"; import { Button } from "@/components/ui/button"; -import { useCodeEditorStore } from "@/store/useCodeEditorStore"; +import { useProblemEditor } from "@/hooks/use-problem-editor"; export default function FormatButton() { - const { editor } = useCodeEditorStore(); + const { editor } = useProblemEditor(); return ( @@ -25,6 +25,7 @@ export default function FormatButton() { editor?.trigger("format", "editor.action.formatDocument", null); }} className="h-6 w-6 px-1.5 py-0.5 border-none shadow-none hover:bg-muted" + disabled={!editor} >