import type { CodeEditorProps } from "@yaakapp-internal/ui/editor"; import { TextViewer as BaseTextViewer, type TextViewerProps } from "@yaakapp-internal/ui"; import { tryFormatJson, tryFormatXml } from "../../lib/formatters"; import { hyperlink } from "../core/Editor/hyperlink/extension"; import { renderEditor } from "../core/Editor/renderEditor"; export const textViewerExtensions = [hyperlink]; export function TextViewer( props: Omit, ) { return ( ); } export async function formatText( text: string, language: CodeEditorProps["language"], ): Promise { if (language === "json") { return tryFormatJson(text); } if (language === "xml" || language === "html") { return tryFormatXml(text); } return text; }