refactor: pre-cleanup.
This commit is contained in:
1 parent
0ceab9d897
commit
e10cbbc92c
53 files changed
+3596
-648
No files matched your search
@@ -0,0 +1,20 @@
|
||||
import { el } from "../base/dom.js";
|
||||
import { renderMarkdown } from "./markdown.js";
|
||||
|
||||
export function sessionTitle(session) {
|
||||
return session.title || session.branch_name || `Conversation ${session.session_id.slice(0, 8)}`;
|
||||
}
|
||||
|
||||
export function chatBubble(message) {
|
||||
const from = message.from ?? message.From ?? "";
|
||||
const text = message.text ?? message.Text ?? "";
|
||||
const isAssistant = from !== "web";
|
||||
return el(
|
||||
`div.chat-bubble-row.${isAssistant ? "assistant" : "user"}`,
|
||||
el(
|
||||
"div.chat-bubble",
|
||||
el("div.chat-bubble-meta", isAssistant ? "Archie" : "You"),
|
||||
isAssistant ? renderMarkdown(text) : el("div.chat-bubble-text", text),
|
||||
),
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user