diff --git a/frontend/components/editor/generate.tsx b/frontend/components/editor/generate.tsx index 6366ba4..bfa7662 100644 --- a/frontend/components/editor/generate.tsx +++ b/frontend/components/editor/generate.tsx @@ -1,6 +1,6 @@ "use client" -import { useEffect, useRef, useState } from "react" +import { useCallback, useEffect, useRef, useState } from "react" import { Button } from "../ui/button" import { Check, Loader2, RotateCw, Sparkles, X } from "lucide-react" import { Socket } from "socket.io-client" @@ -84,6 +84,13 @@ export default function GenerateInput({ } ) } + const handleGenerateForm = useCallback( + (e: React.FormEvent) => { + e.preventDefault() + handleGenerate({ regenerate: false }) + }, + [] + ) useEffect(() => { if (code) { @@ -106,7 +113,10 @@ export default function GenerateInput({ return (
-
+
handleGenerate({})} > {loading.generate ? ( <> @@ -137,13 +147,14 @@ export default function GenerateInput({ -
+ {expanded ? ( <>