chore(ui): clear remaining frontend warnings

Resolve the remaining lint warnings without changing behavior by fixing hook dependency lists, removing the icon naming false positive, and switching the YouTube thumbnail to next/image for compliant rendering.
This commit is contained in:
david_bai
2026-03-27 17:20:49 +08:00
parent 7a1ab18657
commit 7e781631bb
4 changed files with 24 additions and 10 deletions
@@ -225,6 +225,9 @@ const FileListDisplay: React.FC<FileListDisplayProps> = ({
fileProgresses, fileProgresses,
showFinished, showFinished,
activeTransfers, activeTransfers,
mode,
clearSendProgress,
clearReceiveProgress,
folders, folders,
singleFiles, singleFiles,
]); ]);
@@ -286,7 +289,15 @@ const FileListDisplay: React.FC<FileListDisplayProps> = ({
// Update the last status // Update the last status
prevShowFinishedRef.current[item.fileId] = currentShowFinished; prevShowFinishedRef.current[item.fileId] = currentShowFinished;
}); });
}, [showFinished, singleFiles, folders, saveType, onDownload]); }, [
showFinished,
singleFiles,
folders,
saveType,
onDownload,
activeTransfers,
fileProgresses,
]);
//Actions corresponding to each file - progress, download, delete //Actions corresponding to each file - progress, download, delete
const renderItemActions = (item: FileMeta) => { const renderItemActions = (item: FileMeta) => {
@@ -1,4 +1,4 @@
import { Link2, Image, Code } from "lucide-react"; import { Link2, Image as ImageIcon, Code } from "lucide-react";
interface InsertToolsProps { interface InsertToolsProps {
insertLink: () => void; insertLink: () => void;
@@ -25,7 +25,7 @@ export function InsertTools({
onClick={insertImage} onClick={insertImage}
title="Upload image" title="Upload image"
> >
<Image className="w-3.5 h-3.5" /> <ImageIcon className="w-3.5 h-3.5" />
</button> </button>
<button <button
className="p-1.5 hover:bg-accent rounded" className="p-1.5 hover:bg-accent rounded"
@@ -76,7 +76,7 @@ export const useEditorCommands = (
// Update HTML // Update HTML
handleChange(); handleChange();
}, },
[findStyleParent, getSelection, removeStyle] [editorRef, findStyleParent, getSelection, handleChange]
); );
// Align text // Align text
@@ -129,7 +129,7 @@ export const useEditorCommands = (
// Update HTML // Update HTML
handleChange(); handleChange();
}, },
[getSelection] [editorRef, getSelection, handleChange]
); );
// Set font style // Set font style
@@ -218,7 +218,7 @@ export const useEditorCommands = (
handleChange(); handleChange();
}, },
[getSelection, findStyleParent, cleanupSpan] [cleanupSpan, findStyleParent, getSelection, handleChange]
); );
// Insert link // Insert link
@@ -258,7 +258,7 @@ export const useEditorCommands = (
handleChange(); handleChange();
} }
} }
}, [getSelection]); }, [getSelection, handleChange]);
// Insert image // Insert image
const insertImage = useCallback(() => { const insertImage = useCallback(() => {
@@ -290,7 +290,7 @@ export const useEditorCommands = (
} }
}; };
input.click(); input.click();
}, [getSelection]); }, [getSelection, handleChange]);
// Insert code block // Insert code block
const insertCodeBlock = useCallback(() => { const insertCodeBlock = useCallback(() => {
@@ -318,7 +318,7 @@ export const useEditorCommands = (
range.deleteContents(); range.deleteContents();
range.insertNode(pre); range.insertNode(pre);
handleChange(); handleChange();
}, [getSelection]); }, [getSelection, handleChange]);
return { return {
formatText, formatText,
+4 -1
View File
@@ -1,6 +1,7 @@
"use client"; "use client";
import React, { useState, useEffect } from "react"; import React, { useState, useEffect } from "react";
import { Play } from "lucide-react"; import { Play } from "lucide-react";
import Image from "next/image";
interface YouTubePlayerProps { interface YouTubePlayerProps {
videoId: string; videoId: string;
@@ -21,9 +22,11 @@ const YouTubePlayer: React.FC<YouTubePlayerProps> = ({
<div className="relative pb-[56.25%]"> <div className="relative pb-[56.25%]">
{!isPlaying ? ( {!isPlaying ? (
<div className="absolute top-0 left-0 w-full h-full"> <div className="absolute top-0 left-0 w-full h-full">
<img <Image
src={localThumbnail} src={localThumbnail}
alt="Video preview" alt="Video preview"
fill
sizes="(max-width: 1024px) 100vw, 1024px"
className="w-full h-full object-cover" className="w-full h-full object-cover"
/> />
<button <button