feat: add tui ui kit
This commit is contained in:
19
src/tui/components/assistant-message.ts
Normal file
19
src/tui/components/assistant-message.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { Container, Markdown, Spacer } from "@mariozechner/pi-tui";
|
||||
import { markdownTheme, theme } from "../theme/theme.js";
|
||||
|
||||
export class AssistantMessageComponent extends Container {
|
||||
private body: Markdown;
|
||||
|
||||
constructor(text: string) {
|
||||
super();
|
||||
this.body = new Markdown(text, 1, 0, markdownTheme, {
|
||||
color: (line) => theme.fg(line),
|
||||
});
|
||||
this.addChild(new Spacer(1));
|
||||
this.addChild(this.body);
|
||||
}
|
||||
|
||||
setText(text: string) {
|
||||
this.body.setText(text);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user