Skip to content

Commit

Permalink
refactor: copy button on toast
Browse files Browse the repository at this point in the history
  • Loading branch information
xc2 committed Oct 5, 2024
1 parent 4f136c1 commit 43fd06b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion apps/renderer/src/lib/error-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { toast } from "sonner"

import { CopyButton } from "~/components/ui/code-highlighter"
import { Markdown } from "~/components/ui/markdown"
import { cn } from "~/lib/utils"

export const getFetchErrorMessage = (error: Error) => {
if (error instanceof FetchError) {
Expand Down Expand Up @@ -74,7 +75,11 @@ export const toastFetchError = (
...toastOptions,
description: createElement("div", {}, [
createElement(CopyButton, {
className: "float-end relative z-[1]",
className: cn(
"relative z-[1] float-end -mt-1",
"border-transparent bg-theme-background text-theme-foreground opacity-60 transition-opacity",
"hover:bg-theme-button-hover hover:opacity-100 focus:border-theme-foreground/80",
),
key: "copy",
value: _reason,
}),
Expand Down

0 comments on commit 43fd06b

Please sign in to comment.