| | 1 | | @using Syki.Front.Components.Agenda |
| | 2 | |
|
| | 3 | | @namespace Syki.Front.Pages.Student |
| | 4 | |
|
| | 5 | | @page "/student/agenda" |
| | 6 | | @attribute [Authorize(Roles = "Student")] |
| | 7 | |
|
| | 8 | | <SykiPageTitle Title="Agenda" /> |
| | 9 | |
|
| | 10 | | <MudContainer Class="my-4 px-4"> |
| | 11 | | <SykiPageHeader Icon="@Icons.Material.Filled.CalendarMonth" Title="Agenda" Class="mb-4" /> |
| 0 | 12 | | @if (_loading) |
| | 13 | | { |
| | 14 | | <MudContainer Class="px-0"> |
| | 15 | | <MudCard> |
| | 16 | | <MudCardContent> |
| | 17 | | <MudProgressLinear Color="Color.Info" Indeterminate="true" /> |
| | 18 | | </MudCardContent> |
| | 19 | | </MudCard> |
| | 20 | | </MudContainer> |
| | 21 | | } |
| | 22 | | else |
| | 23 | | { |
| 0 | 24 | | @if (Days.Count > 0) |
| | 25 | | { |
| | 26 | | <CascadingValue Name="Days" Value="@Days"> |
| | 27 | | <WeeklyAgenda Class="px-0" /> |
| | 28 | | </CascadingValue> |
| | 29 | | } |
| | 30 | | else |
| | 31 | | { |
| | 32 | | <MudAlert Class="mt-4" Severity="Severity.Normal" NoIcon="true" Variant="Variant.Text" Elevation="1"> |
| | 33 | | <MudStack Row="true" Justify="Justify.SpaceAround"> |
| | 34 | | <MudText>Sua agenda está vazia...</MudText> |
| | 35 | | </MudStack> |
| | 36 | | </MudAlert> |
| | 37 | | } |
| | 38 | | } |
| | 39 | | </MudContainer> |
| | 40 | |
|
| | 41 | | @inject GetStudentAgendaClient Client |
| | 42 | |
|
| | 43 | | @code |
| | 44 | | { |
| | 45 | | private bool _loading; |
| 0 | 46 | | private List<AgendaDayOut> Days = []; |
| | 47 | |
|
| | 48 | | protected override async Task OnInitializedAsync() |
| | 49 | | { |
| 0 | 50 | | _loading = true; |
| 0 | 51 | | Days = await Client.Get(); |
| 0 | 52 | | _loading = false; |
| 0 | 53 | | } |
| | 54 | | } |