diff --git a/webui/src/components/display/blobs/TextViewer.svelte b/webui/src/components/display/blobs/TextViewer.svelte index 0d6d1eb..f36b5ee 100644 --- a/webui/src/components/display/blobs/TextViewer.svelte +++ b/webui/src/components/display/blobs/TextViewer.svelte @@ -4,7 +4,7 @@ import Spinner from "../../utils/Spinner.svelte"; export let address: string; - let mode: "preview" | "full" | "markdown" = "markdown"; + let mode: "preview" | "full" | "markdown" = "preview"; $: textContent = (async () => { const response = await fetch( @@ -19,46 +19,30 @@ return text; } })(); + + const tabs = [ + ["image", "preview", "Preview"], + ["shape-circle", "full", "Full"], + ["edit", "markdown", "Markdown"], + ] as [string, typeof mode, string][];
-
(mode = "preview")} - > - (mode = "preview")} - /> -
Preview
-
-
(mode = "full")} - > - (mode = "full")} - /> -
Full
-
-
(mode = "markdown")} - > - (mode = "markdown")} - /> -
Markdown
-
+ {#each tabs as [icon, targetMode, label]} +
(mode = targetMode)} + > + (mode = targetMode)} + /> +
{label}
+
+ {/each}
{#await textContent}