rename airwatch folder
This commit is contained in:
parent
a05388fcbc
commit
949641d881
262 changed files with 21196 additions and 245 deletions
80
airwatch/src/app/chatbot/message-box/message-box.ts
Normal file
80
airwatch/src/app/chatbot/message-box/message-box.ts
Normal file
|
@ -0,0 +1,80 @@
|
|||
import {Component, Input, OnChanges, SimpleChanges} from '@angular/core';
|
||||
import {DomSanitizer, SafeHtml} from '@angular/platform-browser';
|
||||
|
||||
import {Copy} from 'sae-lib/buttons/copy/copy';
|
||||
import {FeedbackButton} from '../feedback-button/feedback-button';
|
||||
import {ChatbotMessage} from '../../services/chatbot.message.type';
|
||||
import {NgClass} from '@angular/common';
|
||||
import {Store} from '@ngrx/store';
|
||||
import {ActionTypes, StateInterface} from '../../reducers';
|
||||
|
||||
|
||||
type MessageKind = "user" | "llm";
|
||||
|
||||
@Component({
|
||||
selector: 'app-message-box',
|
||||
imports: [
|
||||
Copy,
|
||||
FeedbackButton,
|
||||
NgClass
|
||||
],
|
||||
templateUrl: './message-box.html',
|
||||
styleUrl: './message-box.scss'
|
||||
})
|
||||
export class MessageBox implements OnChanges {
|
||||
|
||||
@Input() kind: MessageKind = <"user" | "llm">""
|
||||
@Input() conf: any = {}
|
||||
@Input() content: any = ""
|
||||
@Input() message: ChatbotMessage = {} as ChatbotMessage;
|
||||
id: string = "00122121221312";
|
||||
sanitizedContent: SafeHtml = "";
|
||||
expanded: boolean = true;
|
||||
displaySourcesPanelLarge: boolean = false;
|
||||
|
||||
constructor(private sanitizer: DomSanitizer,
|
||||
public store: Store<StateInterface>) {
|
||||
this.store.select(state => state.app.displaySourcesPanelLarge).subscribe(value => {
|
||||
this.displaySourcesPanelLarge = value;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges): void {
|
||||
if (changes['content']) {
|
||||
this.sanitizeContent();
|
||||
}
|
||||
}
|
||||
|
||||
sanitizeContent(): void {
|
||||
this.sanitizedContent = this.sanitizer.bypassSecurityTrustHtml(this.content);
|
||||
}
|
||||
|
||||
bookmark() {
|
||||
console.log("TODO bookmark")
|
||||
}
|
||||
|
||||
|
||||
generateResponse() {
|
||||
console.log("TODO generateResponse")
|
||||
}
|
||||
|
||||
editMessage() {
|
||||
console.log("TODO editMessage")
|
||||
}
|
||||
|
||||
toggleSources() {
|
||||
console.log("TODO toggle sources")
|
||||
this.store.dispatch({
|
||||
type: ActionTypes.UPDATE_APP,
|
||||
payload: {
|
||||
displaySourcesPanelLarge: !this.displaySourcesPanelLarge
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
toggleFullScreen() {
|
||||
console.log("TODO toggle fullscreen")
|
||||
this.expanded = !this.expanded;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue