47 lines
1.6 KiB
Plaintext
47 lines
1.6 KiB
Plaintext
@using NexusReader.UI.Shared.Services
|
|
@inject IQuizStateService QuizState
|
|
|
|
<div class="ai-bubble-container">
|
|
<div class="ai-bubble">
|
|
<div class="ai-avatar">
|
|
<div class="avatar-ring"></div>
|
|
<NexusIcon Name="robot" Size="48" Class="neon-pulse" />
|
|
<div class="avatar-label">
|
|
<span class="name">E-Czytnik</span>
|
|
<span class="role">Asystent AI</span>
|
|
</div>
|
|
</div>
|
|
<div class="ai-content">
|
|
<NexusTypography Variant="NexusTypography.TypographyVariant.UI">@Dialogue</NexusTypography>
|
|
|
|
<div class="ai-actions">
|
|
<button class="action-btn ghost" @onclick='() => HandleActionClick("more")'>Pokaż więcej informacji</button>
|
|
<button class="action-btn neon-border" @onclick='() => HandleActionClick("quiz")'>Rozwiąż quiz</button>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="bubble-pointer"></div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
@code {
|
|
[Parameter] public string ContextBlockId { get; set; } = string.Empty;
|
|
[Parameter] public string Dialogue { get; set; } = string.Empty;
|
|
[Parameter] public List<string> Actions { get; set; } = new();
|
|
[Parameter] public EventCallback<string> OnActionTriggered { get; set; }
|
|
|
|
private async Task HandleActionClick(string action)
|
|
{
|
|
if (action.Contains("quiz", StringComparison.OrdinalIgnoreCase))
|
|
{
|
|
QuizState.RequestQuiz(ContextBlockId);
|
|
}
|
|
|
|
if (OnActionTriggered.HasDelegate)
|
|
{
|
|
await OnActionTriggered.InvokeAsync(action);
|
|
}
|
|
}
|
|
}
|