File size: 1,081 Bytes
db25410
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<!-- Oturum yoksa sadece Start Chat düğmesi -->
<div *ngIf="!sessionId" class="start-wrapper">
  <button mat-raised-button color="primary" (click)="startChat()">
    <mat-icon>chat</mat-icon>
    Start Chat
  </button>
</div>

<!-- Oturum başladığında sohbet paneli -->
<mat-card *ngIf="sessionId" class="chat-card">
  <div class="chat-history" #scrollMe>
    <div
      *ngFor="let msg of messages"
      [ngClass]="{
        'msg-row': true,
        me: msg.author === 'user',
        bot: msg.author === 'assistant'
      }"
    >
      <span class="bubble">{{ msg.text }}</span>
    </div>
  </div>

  <form (ngSubmit)="send()" class="input-row" [formGroup]="input">
    <mat-form-field appearance="outline" class="flex-1">
      <input
        matInput
        placeholder="Type your message…"
        formControlName="value"
        autocomplete="off"
      />
    </mat-form-field>

    <button
      mat-icon-button
      color="primary"
      type="submit"
      [disabled]="input.invalid"
    >
      <mat-icon>send</mat-icon>
    </button>
  </form>
</mat-card>