diff --git a/apps/web/src/components/ui/toast.tsx b/apps/web/src/components/ui/toast.tsx index 768a083e2e..a55e36c195 100644 --- a/apps/web/src/components/ui/toast.tsx +++ b/apps/web/src/components/ui/toast.tsx @@ -5,8 +5,10 @@ import { useEffect, type CSSProperties } from "react"; import { useParams } from "@tanstack/react-router"; import { ThreadId } from "@t3tools/contracts"; import { + CheckIcon, CircleAlertIcon, CircleCheckIcon, + CopyIcon, InfoIcon, LoaderCircleIcon, TriangleAlertIcon, @@ -14,6 +16,7 @@ import { import { cn } from "~/lib/utils"; import { buttonVariants } from "~/components/ui/button"; +import { useCopyToClipboard } from "~/hooks/useCopyToClipboard"; import { buildVisibleToastLayout, shouldHideCollapsedToastContent } from "./toast.logic"; type ThreadToastData = { @@ -35,6 +38,25 @@ const TOAST_ICONS = { warning: TriangleAlertIcon, } as const; +function CopyErrorButton({ text }: { text: string }) { + const { copyToClipboard, isCopied } = useCopyToClipboard(); + + return ( + + ); +} + type ToastPosition = | "top-left" | "top-center" @@ -284,12 +306,17 @@ function Toasts({ position = "top-right" }: { position: ToastPosition }) { )}
- +
+ + {toast.type === "error" && typeof toast.description === "string" && ( + + )} +
@@ -373,12 +400,17 @@ function AnchoredToasts() { )}
- +
+ + {toast.type === "error" && typeof toast.description === "string" && ( + + )} +