-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchat-view.component.html
More file actions
38 lines (36 loc) · 1.46 KB
/
chat-view.component.html
File metadata and controls
38 lines (36 loc) · 1.46 KB
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
<div class="sidebar">
<button mat-stroked-button
class="toggle-button"
(click)="toggleChatVisibility()"
[disabled]="userType === 'teacher' && !validChatId">
{{ showOtherChats ? USER_CHATS : OTHER_CHATS }}
</button>
<mat-nav-list>
@for (thread of questionThreads; track thread.id) {
<a mat-list-item
(click)="handleChatItemClick(thread.id)"
[class.active]="thread.id === currentSelectedChatId"
[attr.aria-current]="thread.id === currentSelectedChatId ? 'page' : null"
role="link"
tabindex="0"
(keydown.enter)="handleChatItemClick(thread.id)"
(keydown.space)="handleChatItemClick(thread.id)">
<span class="visibility-badge"
[class.private]="thread.visibility === VisibilityType.PRIVATE"
[class.group]="thread.visibility === VisibilityType.GROUP">
{{ thread.visibility === VisibilityType.PRIVATE ? '💬' : '👥' }}
</span>
{{ thread.name?.slice(0, 50) || UNNAMED_CHAT }}
</a>
}
</mat-nav-list>
</div>
<div class="chatbox">
@if (!validChatId) {
<mat-toolbar color="primary" class="toolbar">
<span>{{ INVALID_CHAT_ID }}</span>
</mat-toolbar>
} @else {
<app-chat [questionThreadId]="currentSelectedChatId"></app-chat>
}
</div>