diff --git a/frontend/src/components/CodeMirror.tsx b/frontend/src/components/CodeMirror.tsx index 1459dac..78d94ce 100644 --- a/frontend/src/components/CodeMirror.tsx +++ b/frontend/src/components/CodeMirror.tsx @@ -12,14 +12,16 @@ import { import { bracketMatching } from "@codemirror/language"; import { html } from "@codemirror/lang-html"; import { EditorTheme } from "@/types"; +import { FaCopy } from "react-icons/fa"; interface Props { code: string; editorTheme: EditorTheme; onCodeChange: (code: string) => void; + doCopyCode: () => void; } -function CodeMirror({ code, editorTheme, onCodeChange }: Props) { +function CodeMirror({ code, editorTheme, onCodeChange, doCopyCode }: Props) { const ref = useRef(null); const view = useRef(null); const editorState = useMemo(() => EditorState.create({ @@ -67,7 +69,16 @@ function CodeMirror({ code, editorTheme, onCodeChange }: Props) { }, [code]); return ( -
+
+
+ + + +
); }