@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 12 lines 533 Bytes
Raw
1 import { msg } from "gt-react";
2
3 import { m, type MessageResolver } from "~/i18n/messages";
4 import { PREVIEW_ERROR_CODE_MESSAGES } from "./previewConstants";
5
6 /** Components pass `useMessages()` so the message follows a language switch. */
7 export function describePreviewError(description: string, resolve: MessageResolver = m): string {
8 const friendly = PREVIEW_ERROR_CODE_MESSAGES[description];
9 if (friendly) return resolve(friendly);
10 if (description.length > 0) return description;
11 return resolve(msg("Network error"));
12 }