victor HF Staff commited on
Commit
804d734
·
1 Parent(s): 41d4eac

fix: Remove unused variables

Browse files
Files changed (1) hide show
  1. src/components/ask-ai/ask-ai.tsx +4 -3
src/components/ask-ai/ask-ai.tsx CHANGED
@@ -1,4 +1,4 @@
1
- import { useState, useRef } from "react"; // Import useRef
2
  import { RiSparkling2Fill } from "react-icons/ri";
3
  import { GrSend } from "react-icons/gr";
4
  import classNames from "classnames";
@@ -28,7 +28,7 @@ function AskAI({
28
  const [prompt, setPrompt] = useState("");
29
  const [hasAsked, setHasAsked] = useState(false);
30
  const [previousPrompt, setPreviousPrompt] = useState("");
31
- const [diffBuffer, setDiffBuffer] = useState(""); // Buffer for accumulating diff chunks
32
  const audio = new Audio(SuccessSound);
33
  audio.volume = 0.5;
34
 
@@ -167,11 +167,12 @@ function AskAI({
167
  };
168
 
169
 
 
170
  // --- Main AI Call Logic ---
171
  const callAi = async () => {
172
  if (isAiWorking || !prompt.trim()) return;
173
  setisAiWorking(true);
174
- setDiffBuffer(""); // Clear buffer for new request
175
 
176
  let fullContentResponse = ""; // Used for full HTML mode
177
  let lastRenderTime = 0; // For throttling full HTML updates
 
1
+ import { useState } from "react"; // Removed useRef import
2
  import { RiSparkling2Fill } from "react-icons/ri";
3
  import { GrSend } from "react-icons/gr";
4
  import classNames from "classnames";
 
28
  const [prompt, setPrompt] = useState("");
29
  const [hasAsked, setHasAsked] = useState(false);
30
  const [previousPrompt, setPreviousPrompt] = useState("");
31
+ // Removed unused diffBuffer state: const [diffBuffer, setDiffBuffer] = useState("");
32
  const audio = new Audio(SuccessSound);
33
  audio.volume = 0.5;
34
 
 
167
  };
168
 
169
 
170
+ // --- Main AI Call Logic ---
171
  // --- Main AI Call Logic ---
172
  const callAi = async () => {
173
  if (isAiWorking || !prompt.trim()) return;
174
  setisAiWorking(true);
175
+ // Removed setDiffBuffer("") call
176
 
177
  let fullContentResponse = ""; // Used for full HTML mode
178
  let lastRenderTime = 0; // For throttling full HTML updates