Spaces:
Running
Running
Update flare-ui/src/app/components/chat/chat.component.html
Browse files
flare-ui/src/app/components/chat/chat.component.html
CHANGED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!-- Oturum yoksa sadece Start Chat düğmesi -->
|
2 |
+
<div *ngIf="!sessionId" class="start-wrapper">
|
3 |
+
<button mat-raised-button color="primary" (click)="startChat()">
|
4 |
+
<mat-icon>chat</mat-icon>
|
5 |
+
Start Chat
|
6 |
+
</button>
|
7 |
+
</div>
|
8 |
+
|
9 |
+
<!-- Oturum başladığında sohbet paneli -->
|
10 |
+
<mat-card *ngIf="sessionId" class="chat-card">
|
11 |
+
<div class="chat-history" #scrollMe>
|
12 |
+
<div
|
13 |
+
*ngFor="let msg of messages"
|
14 |
+
[ngClass]="{
|
15 |
+
'msg-row': true,
|
16 |
+
me: msg.author === 'user',
|
17 |
+
bot: msg.author === 'assistant'
|
18 |
+
}"
|
19 |
+
>
|
20 |
+
<span class="bubble">{{ msg.text }}</span>
|
21 |
+
</div>
|
22 |
+
</div>
|
23 |
+
|
24 |
+
<form (ngSubmit)="send()" class="input-row" [formGroup]="input">
|
25 |
+
<mat-form-field appearance="outline" class="flex-1">
|
26 |
+
<input
|
27 |
+
matInput
|
28 |
+
placeholder="Type your message…"
|
29 |
+
formControlName="value"
|
30 |
+
autocomplete="off"
|
31 |
+
/>
|
32 |
+
</mat-form-field>
|
33 |
+
|
34 |
+
<button
|
35 |
+
mat-icon-button
|
36 |
+
color="primary"
|
37 |
+
type="submit"
|
38 |
+
[disabled]="input.invalid"
|
39 |
+
>
|
40 |
+
<mat-icon>send</mat-icon>
|
41 |
+
</button>
|
42 |
+
</form>
|
43 |
+
</mat-card>
|