Spracherkennung für: .ts vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]
import { html, nothing, type TemplateResult } from "lit";
import { unsafeHTML } from "lit/directives/unsafe-html.js";
import { icons } from "../icons.ts";
import { toSanitizedMarkdownHtml } from "../markdown.ts";
import { detectTextDirection } from "../text-direction.ts";
import type { ChatSideResult } from "./side-result.ts";
export function renderSideResult(
sideResult: ChatSideResult | null | undefined,
onDismiss?: () => void,
): TemplateResult | typeof nothing {
if (!sideResult) {
return nothing;
}
return html`
<section
class=${`chat-side-result ${sideResult.isError ? "chat-side-result--error" : ""}`}
role="status"
aria-live="polite"
aria-label="BTW side result"
>
<div class="chat-side-result__header">
<div class="chat-side-result__label-row">
<span class="chat-side-result__label">BTW</span>
<span class="chat-side-result__meta">Not saved to chat history</span>
</div>
<button
class="btn chat-side-result__dismiss"
type="button"
aria-label="Dismiss BTW result"
title="Dismiss"
@click=${() => onDismiss?.()}
>
${icons.x}
</button>
</div>
<div class="chat-side-result__question">${sideResult.question}</div>
<div class="chat-side-result__body" dir=${detectTextDirection(sideResult.text)}>
${unsafeHTML(toSanitizedMarkdownHtml(sideResult.text))}
</div>
</section>
`;
}
¤ Dauer der Verarbeitung: 0.15 Sekunden
(vorverarbeitet am 2026-04-27)
¤
*© Formatika GbR, Deutschland