Add shadcn alert to match project design

This commit is contained in:
NicolasMontone
2025-04-01 17:38:25 -03:00
parent 539de0fd85
commit 8586d63e6d
9 changed files with 611 additions and 32 deletions

View File

@@ -17,7 +17,7 @@ import { Copy, Send, CheckCheck } from "lucide-react";
import { useCallback, useEffect, useState } from "react";
import ListPane from "./ListPane";
import JsonView from "./JsonView";
import { toast } from "react-toastify";
import { useToast } from "@/hooks/use-toast";
const ToolsTab = ({
tools,
@@ -39,6 +39,7 @@ const ToolsTab = ({
nextCursor: ListToolsResult["nextCursor"];
error: string | null;
}) => {
const { toast } = useToast();
const [params, setParams] = useState<Record<string, unknown>>({});
useEffect(() => {
setParams({});
@@ -54,11 +55,13 @@ const ToolsTab = ({
setCopied(false);
}, 500);
} catch (error) {
toast.error(
`There was an error coping result into the clipboard: ${error instanceof Error ? error.message : String(error)}`,
);
toast({
title: "Error",
description: `There was an error coping result into the clipboard: ${error instanceof Error ? error.message : String(error)}`,
variant: "destructive",
});
}
}, [toolResult]);
}, [toast, toolResult]);
const renderToolResult = () => {
if (!toolResult) return null;