@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 04:45 UTC

main
ts 19 lines 523 Bytes
Raw
1 import type { RefObject } from "react";
2 import { msg } from "gt-react";
3
4 import { m } from "~/i18n/messages";
5 import { anchoredToastManager } from "./toast";
6
7 export const ANCHORED_COPY_TOAST_TIMEOUT_MS = 1000;
8
9 export function showAnchoredCopyErrorToast(ref: RefObject<HTMLButtonElement | null>, error: Error) {
10 if (!ref.current) return;
11 anchoredToastManager.add({
12 type: "error",
13 positionerProps: {
14 anchor: ref.current,
15 },
16 title: m(msg("Failed to copy")),
17 description: error.message,
18 });
19 }