48 lines
1.0 KiB
Plaintext
48 lines
1.0 KiB
Plaintext
@page "/citizen/dashboard"
|
|
@inject HttpClient http
|
|
@inject AppState state
|
|
|
|
<h3>Welcome, @state.User!.Name!</h3>
|
|
|
|
@if (retrievingProfile)
|
|
{
|
|
<p>Retrieving your employment profile...</p>
|
|
}
|
|
else if (profile != null)
|
|
{
|
|
<p>Your employment profile was last updated @profile.LastUpdatedOn</p>
|
|
}
|
|
else
|
|
{
|
|
<p>You do not have an employment profile established; click “Profile”* in the menu to get started!</p>
|
|
<p><em>* Once it's there...</em></p>
|
|
}
|
|
|
|
@if (errorMessage != null)
|
|
{
|
|
<p>@errorMessage</p>
|
|
}
|
|
@code {
|
|
|
|
bool retrievingProfile = true;
|
|
JobsJobsJobs.Shared.Profile? profile = null;
|
|
string? errorMessage = null;
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
if (state.User != null)
|
|
{
|
|
var profileResult = await ServerApi.RetrieveProfile(http, state);
|
|
if (profileResult.IsOk)
|
|
{
|
|
profile = profileResult.Ok;
|
|
}
|
|
else
|
|
{
|
|
errorMessage = profileResult.Error;
|
|
}
|
|
retrievingProfile = false;
|
|
}
|
|
}
|
|
}
|