fixing lint error
This commit is contained in:
@@ -103,13 +103,16 @@ const Sidebar = ({
|
|||||||
const { toast } = useToast();
|
const { toast } = useToast();
|
||||||
|
|
||||||
// Reusable error reporter for copy actions
|
// Reusable error reporter for copy actions
|
||||||
function reportError(error: unknown) {
|
const reportError = useCallback(
|
||||||
toast({
|
(error: unknown) => {
|
||||||
title: "Error",
|
toast({
|
||||||
description: `Failed to copy config: ${error instanceof Error ? error.message : String(error)}`,
|
title: "Error",
|
||||||
variant: "destructive",
|
description: `Failed to copy config: ${error instanceof Error ? error.message : String(error)}`,
|
||||||
});
|
variant: "destructive",
|
||||||
}
|
});
|
||||||
|
},
|
||||||
|
[toast],
|
||||||
|
);
|
||||||
|
|
||||||
// Shared utility function to generate server config
|
// Shared utility function to generate server config
|
||||||
const generateServerConfig = useCallback(() => {
|
const generateServerConfig = useCallback(() => {
|
||||||
@@ -182,7 +185,7 @@ const Sidebar = ({
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
reportError(error);
|
reportError(error);
|
||||||
}
|
}
|
||||||
}, [generateMCPServerEntry, transportType, toast]);
|
}, [generateMCPServerEntry, transportType, toast, reportError]);
|
||||||
|
|
||||||
const handleCopyServerFile = useCallback(() => {
|
const handleCopyServerFile = useCallback(() => {
|
||||||
try {
|
try {
|
||||||
@@ -208,7 +211,7 @@ const Sidebar = ({
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
reportError(error);
|
reportError(error);
|
||||||
}
|
}
|
||||||
}, [generateMCPServerFile, toast]);
|
}, [generateMCPServerFile, toast, reportError]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="w-80 bg-card border-r border-border flex flex-col h-full">
|
<div className="w-80 bg-card border-r border-border flex flex-col h-full">
|
||||||
|
|||||||
Reference in New Issue
Block a user