forked from shuyu-labs/WebCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChatToolbarPanel.razor
More file actions
72 lines (68 loc) · 4.24 KB
/
ChatToolbarPanel.razor
File metadata and controls
72 lines (68 loc) · 4.24 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
@if (Show)
{
<div class="flex gap-2 sm:gap-3 mb-1 sm:mb-2 lg:mb-2 flex-shrink-0 flex-wrap">
@LeadingContent
@if (ShowSessionButton)
{
<button @onclick="OnToggleSessionList"
class="btn-default flex items-center gap-1 sm:gap-1.5 whitespace-nowrap shadow-sm hover:shadow-md transition-all text-xs sm:text-sm px-3 sm:px-4 py-2 min-h-[40px] sm:min-h-[44px]"
title="@SessionHistoryTitle">
<svg class="w-3.5 h-3.5 sm:w-4 sm:h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"></path>
</svg>
<span class="hidden sm:inline">@SessionHistoryText</span>
</button>
}
@if (ShowProjectButton)
{
<button @onclick="OnShowProjectManage"
class="btn-default flex items-center gap-1 sm:gap-1.5 whitespace-nowrap shadow-sm hover:shadow-md transition-all text-xs sm:text-sm px-3 sm:px-4 py-2 min-h-[40px] sm:min-h-[44px]"
title="@ProjectTitle">
<svg class="w-3.5 h-3.5 sm:w-4 sm:h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"></path>
</svg>
<span class="hidden sm:inline">@ProjectText</span>
</button>
}
@if (ShowContextButton)
{
<button @onclick="OnToggleContext"
class="btn-default flex items-center gap-1 sm:gap-1.5 whitespace-nowrap shadow-sm hover:shadow-md transition-all text-xs sm:text-sm px-3 sm:px-4 py-2 min-h-[40px] sm:min-h-[44px]"
title="@ContextTitle">
<svg class="w-3.5 h-3.5 sm:w-4 sm:h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path>
</svg>
<span class="hidden sm:inline">@ContextText</span>
</button>
}
@if (ShowClearChatButton)
{
<button @onclick="OnClearChat"
class="btn-default flex items-center gap-1 sm:gap-1.5 whitespace-nowrap shadow-sm hover:shadow-md transition-all text-xs sm:text-sm px-3 sm:px-4 py-2 min-h-[40px] sm:min-h-[44px]">
<svg class="w-3.5 h-3.5 sm:w-4 sm:h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"></path>
</svg>
<span class="hidden sm:inline">@ClearChatText</span>
</button>
}
</div>
}
@code {
[Parameter] public bool Show { get; set; } = true;
[Parameter] public RenderFragment? LeadingContent { get; set; }
[Parameter] public string SessionHistoryTitle { get; set; } = string.Empty;
[Parameter] public string SessionHistoryText { get; set; } = string.Empty;
[Parameter] public string ProjectTitle { get; set; } = string.Empty;
[Parameter] public string ProjectText { get; set; } = string.Empty;
[Parameter] public string ContextTitle { get; set; } = string.Empty;
[Parameter] public string ContextText { get; set; } = string.Empty;
[Parameter] public string ClearChatText { get; set; } = string.Empty;
[Parameter] public bool ShowSessionButton { get; set; } = true;
[Parameter] public bool ShowProjectButton { get; set; } = true;
[Parameter] public bool ShowContextButton { get; set; } = true;
[Parameter] public bool ShowClearChatButton { get; set; } = true;
[Parameter] public EventCallback OnToggleSessionList { get; set; }
[Parameter] public EventCallback OnShowProjectManage { get; set; }
[Parameter] public EventCallback OnToggleContext { get; set; }
[Parameter] public EventCallback OnClearChat { get; set; }
}