diff --git a/src/components/snippet-edit-form.tsx b/src/components/snippet-edit-form.tsx index 304ca20..9e93a11 100644 --- a/src/components/snippet-edit-form.tsx +++ b/src/components/snippet-edit-form.tsx @@ -1,5 +1,6 @@ "use client"; +import { useState } from "react"; import { Snippet } from "@prisma/client"; import { Editor } from "@monaco-editor/react"; @@ -8,6 +9,12 @@ interface SnippetEditFormProps { } export default function SnippetEditForm({ snippet }: SnippetEditFormProps) { + const [code, setCode] = useState(snippet.code); + + const handleEditorChange = (value: string = "") => { + setCode(value); + }; + return (