fix: build errors fix attempt

This commit is contained in:
2024-05-19 15:21:31 +02:00
parent 46985c9623
commit 5168b2e499
10 changed files with 9 additions and 31 deletions

View File

@@ -4,7 +4,6 @@ import { ComponentProps } from "react";
import MonacoEditor from "@monaco-editor/react";
import { useTheme } from "next-themes";
// @ts-expect-error react 19 beta error
export type EditorProps = ComponentProps<typeof MonacoEditor>;
/**
@@ -13,25 +12,19 @@ export type EditorProps = ComponentProps<typeof MonacoEditor>;
* @see https://github.com/suren-atoyan/monaco-react/issues/346
*
*/
// @ts-expect-error react 19 beta error
export const Editor = ({ options, theme, ...props }: EditorProps) => {
const { theme: appTheme } = useTheme();
const themeToUse = theme ?? (appTheme === "light" ? "light" : "vs-dark");
return (
// @ts-expect-error react 19 beta error
<MonacoEditor
// @ts-expect-error react 19 beta error
theme={themeToUse}
// @ts-expect-error react 19 beta error
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
options={{
tabFocusMode: true,
detectIndentation: false,
minimap: { enabled: false },
automaticLayout: true,
scrollBeyondLastLine: false,
// @ts-expect-error react 19 beta error
...options, // NOTE: merge shallowly
}}
{...props}