Skip to content

Commit d40140c

Browse files
fixing lint error
1 parent e3076ae commit d40140c

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

client/src/components/Sidebar.tsx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,16 @@ const Sidebar = ({
103103
const { toast } = useToast();
104104

105105
// Reusable error reporter for copy actions
106-
function reportError(error: unknown) {
107-
toast({
108-
title: "Error",
109-
description: `Failed to copy config: ${error instanceof Error ? error.message : String(error)}`,
110-
variant: "destructive",
111-
});
112-
}
106+
const reportError = useCallback(
107+
(error: unknown) => {
108+
toast({
109+
title: "Error",
110+
description: `Failed to copy config: ${error instanceof Error ? error.message : String(error)}`,
111+
variant: "destructive",
112+
});
113+
},
114+
[toast],
115+
);
113116

114117
// Shared utility function to generate server config
115118
const generateServerConfig = useCallback(() => {
@@ -182,7 +185,7 @@ const Sidebar = ({
182185
} catch (error) {
183186
reportError(error);
184187
}
185-
}, [generateMCPServerEntry, transportType, toast]);
188+
}, [generateMCPServerEntry, transportType, toast, reportError]);
186189

187190
const handleCopyServerFile = useCallback(() => {
188191
try {
@@ -208,7 +211,7 @@ const Sidebar = ({
208211
} catch (error) {
209212
reportError(error);
210213
}
211-
}, [generateMCPServerFile, toast]);
214+
}, [generateMCPServerFile, toast, reportError]);
212215

213216
return (
214217
<div className="w-80 bg-card border-r border-border flex flex-col h-full">

0 commit comments

Comments
 (0)