diff --git a/src/components/snippet-edit-form.tsx b/src/components/snippet-edit-form.tsx index ac02c7f..bafb2f7 100644 --- a/src/components/snippet-edit-form.tsx +++ b/src/components/snippet-edit-form.tsx @@ -3,7 +3,7 @@ import { useState } from "react"; import * as actions from "@/actions"; import { Snippet } from "@prisma/client"; -import { Editor } from "@monaco-editor/react"; +import { DiffEditor, Editor } from "@monaco-editor/react"; interface SnippetEditFormProps { snippet: Snippet; @@ -11,6 +11,8 @@ interface SnippetEditFormProps { export default function SnippetEditForm({ snippet }: SnippetEditFormProps) { const [code, setCode] = useState(snippet.code); + const [originalCode, setOriginalCode] = useState(snippet.code); + const [modifiedCode, setModifiedCode] = useState(snippet.code); const handleEditorChange = (value: string = "") => { setCode(value); @@ -18,21 +20,44 @@ export default function SnippetEditForm({ snippet }: SnippetEditFormProps) { const editSnippetAction = actions.editSnippet.bind(null, snippet.id, code); + const handleAskAI = () => { + setModifiedCode("AI generated code"); + }; + return ( -
- + {/* */} + -
- + -
+
); }