mirror of
https://github.com/massbug/judge4c.git
synced 2025-05-18 07:16:34 +00:00
fix(editor/footer): delay the import of Monaco's MarkerSeverity until window is defined
This commit is contained in:
parent
3e5e2d2a62
commit
a7419fe1ba
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { MarkerSeverity } from "monaco-editor";
|
|
||||||
import { useProblem } from "@/hooks/use-problem";
|
import { useProblem } from "@/hooks/use-problem";
|
||||||
import { CircleXIcon, TriangleAlertIcon } from "lucide-react";
|
import { CircleXIcon, TriangleAlertIcon } from "lucide-react";
|
||||||
|
|
||||||
@ -10,6 +9,13 @@ interface WorkspaceEditorFooterProps {
|
|||||||
className?: string;
|
className?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let MarkerSeverity: typeof import("monaco-editor").MarkerSeverity;
|
||||||
|
if (typeof window !== "undefined") {
|
||||||
|
import("monaco-editor").then((monaco) => {
|
||||||
|
MarkerSeverity = monaco.MarkerSeverity;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
export function WorkspaceEditorFooter({
|
export function WorkspaceEditorFooter({
|
||||||
className,
|
className,
|
||||||
...props
|
...props
|
||||||
|
Loading…
Reference in New Issue
Block a user