fix: remove 8 unused variables in File Manager and Host Manager components
Cleaned up unused imports, state variables, and function parameters: - DiffViewer.tsx: removed unused error parameter in catch block - FileViewer.tsx: removed ReactPlayer import, unused originalContent state, node parameters from markdown code components, audio variable - HostManager.tsx: removed onSelectView and updatedHost parameters - TunnelViewer.tsx: removed TunnelConnection import Reduced lint errors from 271 to 208 (63 errors fixed total)
This commit is contained in:
@@ -61,7 +61,7 @@ export function DiffViewer({
|
|||||||
userId: sshHost.userId,
|
userId: sshHost.userId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch {
|
||||||
await connectSSH(sshSessionId, {
|
await connectSSH(sshSessionId, {
|
||||||
hostId: sshHost.id,
|
hostId: sshHost.id,
|
||||||
ip: sshHost.ip,
|
ip: sshHost.ip,
|
||||||
|
|||||||
@@ -60,7 +60,6 @@ import {
|
|||||||
import { autocompletion, completionKeymap } from "@codemirror/autocomplete";
|
import { autocompletion, completionKeymap } from "@codemirror/autocomplete";
|
||||||
import { PhotoProvider, PhotoView } from "react-photo-view";
|
import { PhotoProvider, PhotoView } from "react-photo-view";
|
||||||
import "react-photo-view/dist/react-photo-view.css";
|
import "react-photo-view/dist/react-photo-view.css";
|
||||||
import ReactPlayer from "react-player";
|
|
||||||
import AudioPlayer from "react-h5-audio-player";
|
import AudioPlayer from "react-h5-audio-player";
|
||||||
import "react-h5-audio-player/lib/styles.css";
|
import "react-h5-audio-player/lib/styles.css";
|
||||||
import ReactMarkdown from "react-markdown";
|
import ReactMarkdown from "react-markdown";
|
||||||
@@ -311,9 +310,7 @@ export function FileViewer({
|
|||||||
}: FileViewerProps) {
|
}: FileViewerProps) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [editedContent, setEditedContent] = useState(content);
|
const [editedContent, setEditedContent] = useState(content);
|
||||||
const [originalContent, setOriginalContent] = useState(
|
const [, setOriginalContent] = useState(savedContent || content);
|
||||||
savedContent || content,
|
|
||||||
);
|
|
||||||
const [hasChanges, setHasChanges] = useState(false);
|
const [hasChanges, setHasChanges] = useState(false);
|
||||||
const [showLargeFileWarning, setShowLargeFileWarning] = useState(false);
|
const [showLargeFileWarning, setShowLargeFileWarning] = useState(false);
|
||||||
const [forceShowAsText, setForceShowAsText] = useState(false);
|
const [forceShowAsText, setForceShowAsText] = useState(false);
|
||||||
@@ -1097,7 +1094,7 @@ export function FileViewer({
|
|||||||
<ReactMarkdown
|
<ReactMarkdown
|
||||||
remarkPlugins={[remarkGfm]}
|
remarkPlugins={[remarkGfm]}
|
||||||
components={{
|
components={{
|
||||||
code({ node, inline, className, children, ...props }) {
|
code({ inline, className, children, ...props }) {
|
||||||
const match = /language-(\w+)/.exec(className || "");
|
const match = /language-(\w+)/.exec(className || "");
|
||||||
return !inline && match ? (
|
return !inline && match ? (
|
||||||
<SyntaxHighlighter
|
<SyntaxHighlighter
|
||||||
@@ -1380,8 +1377,7 @@ export function FileViewer({
|
|||||||
<div className="rounded-lg overflow-hidden">
|
<div className="rounded-lg overflow-hidden">
|
||||||
<AudioPlayer
|
<AudioPlayer
|
||||||
src={audioUrl}
|
src={audioUrl}
|
||||||
onLoadedMetadata={(e) => {
|
onLoadedMetadata={() => {
|
||||||
const audio = e.currentTarget;
|
|
||||||
if (onMediaDimensionsChange) {
|
if (onMediaDimensionsChange) {
|
||||||
onMediaDimensionsChange({
|
onMediaDimensionsChange({
|
||||||
width: 600,
|
width: 600,
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ import { useTranslation } from "react-i18next";
|
|||||||
import type { SSHHost, HostManagerProps } from "../../../types/index";
|
import type { SSHHost, HostManagerProps } from "../../../types/index";
|
||||||
|
|
||||||
export function HostManager({
|
export function HostManager({
|
||||||
onSelectView,
|
|
||||||
isTopbarOpen,
|
isTopbarOpen,
|
||||||
}: HostManagerProps): React.ReactElement {
|
}: HostManagerProps): React.ReactElement {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@@ -30,7 +29,7 @@ export function HostManager({
|
|||||||
setActiveTab("add_host");
|
setActiveTab("add_host");
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleFormSubmit = (updatedHost?: SSHHost) => {
|
const handleFormSubmit = () => {
|
||||||
setEditingHost(null);
|
setEditingHost(null);
|
||||||
setActiveTab("host_viewer");
|
setActiveTab("host_viewer");
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,11 +1,7 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { TunnelObject } from "./TunnelObject.tsx";
|
import { TunnelObject } from "./TunnelObject.tsx";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import type {
|
import type { SSHHost, TunnelStatus } from "../../../types/index.js";
|
||||||
SSHHost,
|
|
||||||
TunnelConnection,
|
|
||||||
TunnelStatus,
|
|
||||||
} from "../../../types/index.js";
|
|
||||||
|
|
||||||
interface SSHTunnelViewerProps {
|
interface SSHTunnelViewerProps {
|
||||||
hosts: SSHHost[];
|
hosts: SSHHost[];
|
||||||
|
|||||||
Reference in New Issue
Block a user