Skip to content

Commit 9661a26

Browse files
committed
Fix linting warning: remove unused isHovering variable
- Remove isHovering state since we now use showPopup state - Clean up mouse handlers to not set unused state - Fixes TypeScript linting warning
1 parent cafe1b3 commit 9661a26

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

app/components/TextGenerator/TranslatableWord.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ const getCacheKey = (word: string, sourceLang: string, targetLang: string): stri
2121
const TranslatableWord = memo(
2222
({ word, fromLang, toLang, isCurrentWord, isRelevant }: TranslatableWordProps) => {
2323
const [isClicked, setIsClicked] = useState(false);
24-
const [isHovering, setIsHovering] = useState(false);
2524
const [translation, setTranslation] = useState<string | null>(null);
2625
const [isLoading, setIsLoading] = useState(false);
2726
const [isSpeaking, setIsSpeaking] = useState(false);
@@ -155,14 +154,12 @@ const TranslatableWord = memo(
155154
]);
156155

157156
const handleMouseEnter = useCallback(() => {
158-
setIsHovering(true);
159157
if (translation) {
160158
setShowPopup(true);
161159
}
162160
}, [translation]);
163161

164162
const handleMouseLeave = useCallback(() => {
165-
setIsHovering(false);
166163
// Hide popup after a short delay to allow clicking
167164
setTimeout(() => {
168165
if (!isClicked) {
@@ -188,8 +185,7 @@ const TranslatableWord = memo(
188185
}
189186
}
190187

191-
const showTranslationPopup =
192-
showPopup && shouldTranslate && !isLoading && translation !== null;
188+
const showTranslationPopup = showPopup && shouldTranslate && !isLoading && translation !== null;
193189

194190
const dataTestIdProps = isRelevant ? { 'data-testid': 'feedback-highlight' } : {};
195191

0 commit comments

Comments
 (0)