| | | 1 | | @using Chronicis.Shared.DTOs.Quests |
| | | 2 | | @using Chronicis.Shared.Enums |
| | | 3 | | |
| | | 4 | | <div class="arc-quest-timeline"> |
| | 0 | 5 | | @if (_quest != null) |
| | | 6 | | { |
| | | 7 | | <div class="d-flex align-center justify-space-between mb-3"> |
| | | 8 | | <MudText Typo="Typo.h6" Style="color: var(--chronicis-beige-gold);"> |
| | | 9 | | <MudIcon Icon="@Icons.Material.Filled.Timeline" Size="Size.Small" Class="mr-2" /> |
| | | 10 | | Quest Updates |
| | | 11 | | </MudText> |
| | | 12 | | |
| | 0 | 13 | | @if (_quest.UpdateCount > 0) |
| | | 14 | | { |
| | | 15 | | <MudText Typo="Typo.caption" Class="text-muted"> |
| | 0 | 16 | | @_quest.UpdateCount update@(_quest.UpdateCount == 1 ? "" : "s") |
| | | 17 | | </MudText> |
| | | 18 | | } |
| | | 19 | | </div> |
| | | 20 | | |
| | 0 | 21 | | @if (_isLoading && !_updates.Any()) |
| | | 22 | | { |
| | | 23 | | <MudProgressCircular Color="Color.Primary" Indeterminate="true" Size="Size.Small" /> |
| | | 24 | | } |
| | 0 | 25 | | else if (_updates.Any()) |
| | | 26 | | { |
| | | 27 | | <MudTimeline TimelinePosition="TimelinePosition.Start" TimelineOrientation="TimelineOrientation.Vertical"> |
| | 0 | 28 | | @foreach (var update in _updates) |
| | | 29 | | { |
| | | 30 | | <MudTimelineItem Color="Color.Info" Size="Size.Small"> |
| | | 31 | | <ItemOpposite> |
| | | 32 | | <MudText Typo="Typo.caption" Class="text-muted"> |
| | 0 | 33 | | @update.CreatedAt.ToString("MMM d, yyyy h:mm tt") |
| | | 34 | | </MudText> |
| | | 35 | | </ItemOpposite> |
| | | 36 | | <ItemContent> |
| | | 37 | | <MudCard Elevation="2" Class="quest-update-card"> |
| | | 38 | | <MudCardContent> |
| | | 39 | | <!-- Author and Session Info --> |
| | | 40 | | <div class="d-flex align-center justify-space-between mb-2"> |
| | | 41 | | <div class="d-flex align-center gap-2"> |
| | 0 | 42 | | @if (!string.IsNullOrEmpty(update.CreatedByAvatarUrl)) |
| | | 43 | | { |
| | | 44 | | <MudAvatar Size="Size.Small"> |
| | | 45 | | <MudImage Src="@update.CreatedByAvatarUrl" /> |
| | | 46 | | </MudAvatar> |
| | | 47 | | } |
| | | 48 | | else |
| | | 49 | | { |
| | | 50 | | <MudAvatar Size="Size.Small" Color="Color.Primary"> |
| | 0 | 51 | | @update.CreatedByName.FirstOrDefault() |
| | | 52 | | </MudAvatar> |
| | | 53 | | } |
| | 0 | 54 | | <MudText Typo="Typo.body2">@update.CreatedByName</MudText> |
| | | 55 | | |
| | 0 | 56 | | @if (update.SessionId.HasValue && !string.IsNullOrEmpty(update.SessionTitle) |
| | | 57 | | { |
| | | 58 | | <MudChip T="string" Size="Size.Small" Variant="Variant.Text" Color="Colo |
| | 0 | 59 | | Session: @update.SessionTitle |
| | | 60 | | </MudChip> |
| | | 61 | | } |
| | | 62 | | </div> |
| | | 63 | | |
| | 0 | 64 | | @if (CanDeleteUpdate(update)) |
| | | 65 | | { |
| | | 66 | | <MudIconButton Icon="@Icons.Material.Filled.Delete" |
| | | 67 | | Size="Size.Small" |
| | | 68 | | Color="Color.Error" |
| | 0 | 69 | | OnClick="@(() => DeleteUpdate(update))" /> |
| | | 70 | | } |
| | | 71 | | </div> |
| | | 72 | | |
| | | 73 | | <!-- Update Body (HTML from TipTap) --> |
| | | 74 | | <div class="quest-update-body"> |
| | 0 | 75 | | @((MarkupString)update.Body) |
| | | 76 | | </div> |
| | | 77 | | </MudCardContent> |
| | | 78 | | </MudCard> |
| | | 79 | | </ItemContent> |
| | | 80 | | </MudTimelineItem> |
| | | 81 | | } |
| | | 82 | | </MudTimeline> |
| | | 83 | | |
| | | 84 | | <!-- Load More Button --> |
| | 0 | 85 | | @if (_hasMore) |
| | | 86 | | { |
| | | 87 | | <div class="text-center mt-3"> |
| | | 88 | | <MudButton Variant="Variant.Outlined" |
| | | 89 | | Color="Color.Primary" |
| | | 90 | | OnClick="LoadMoreAsync" |
| | | 91 | | Disabled="_isLoadingMore"> |
| | 0 | 92 | | @if (_isLoadingMore) |
| | | 93 | | { |
| | | 94 | | <MudProgressCircular Size="Size.Small" Indeterminate="true" Class="mr-2" /> |
| | | 95 | | } |
| | | 96 | | Load More |
| | | 97 | | </MudButton> |
| | | 98 | | </div> |
| | | 99 | | } |
| | | 100 | | } |
| | | 101 | | else |
| | | 102 | | { |
| | | 103 | | <MudAlert Severity="Severity.Info"> |
| | | 104 | | No updates yet. Quest updates will appear here as progress is made. |
| | | 105 | | </MudAlert> |
| | | 106 | | } |
| | | 107 | | } |
| | | 108 | | else |
| | | 109 | | { |
| | | 110 | | <MudAlert Severity="Severity.Info"> |
| | | 111 | | Select a quest to view updates |
| | | 112 | | </MudAlert> |
| | | 113 | | } |
| | | 114 | | </div> |