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
| 1 | import type { FilePreviewKind } from "@t3tools/shared/filePreview"; |
| 2 | |
| 3 | export function attachmentDocumentPresentation(input: { |
| 4 | kind: FilePreviewKind; |
| 5 | hasTable: boolean; |
| 6 | hasEnvironment: boolean; |
| 7 | rendered: boolean; |
| 8 | }) { |
| 9 | const renderedMode = input.hasTable |
| 10 | ? "table" |
| 11 | : input.kind === "markdown" && input.hasEnvironment |
| 12 | ? "markdown" |
| 13 | : input.kind === "html" |
| 14 | ? "html" |
| 15 | : null; |
| 16 | return { |
| 17 | renderedMode, |
| 18 | activeMode: input.rendered && renderedMode !== null ? renderedMode : "source", |
| 19 | } as const; |
| 20 | } |