diff --git a/commafeed-client/src/components/code/CodeEditor.tsx b/commafeed-client/src/components/code/CodeEditor.tsx new file mode 100644 index 00000000..05eda806 --- /dev/null +++ b/commafeed-client/src/components/code/CodeEditor.tsx @@ -0,0 +1,36 @@ +import { Input, Textarea } from "@mantine/core" +import RichCodeEditor from "components/code/RichCodeEditor" +import { useMobile } from "hooks/useMobile" +import { ReactNode } from "react" + +interface CodeEditorProps { + description?: ReactNode + language: "css" | "javascript" + value: string + onChange: (value: string | undefined) => void +} + +export function CodeEditor(props: CodeEditorProps) { + const mobile = useMobile() + + return mobile ? ( + // monaco mobile support is poor, fallback to textarea +