using FoodsharingSiegen.Contracts.Entity;
using FoodsharingSiegen.Contracts.Model;
using FoodsharingSiegen.Server.Auth;
using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.Options;
namespace FoodsharingSiegen.Server.Shared
{
///
/// The nav menu class (a. beging, 07.02.2023)
///
public partial class NavMenu
{
#region Dependencies
[Inject]
private IOptions AppSettingsContainer { get; set; } = null!;
[Inject]
protected AuthService AuthService { get; set; } = null!;
#endregion
#region Private Properties
///
/// Gets the value of the current user (ab)
///
private User CurrentUser => AuthService.User ?? new User();
#endregion
#region Protected Properties
/// Provides application-specific settings used to configure the behavior and display of the application.
/// The AppSettings class encapsulates information such as the application title and other configurable parameters.
protected AppSettings AppSettings => AppSettingsContainer.Value;
#endregion
#region Override OnInitializedAsync
///
/// Ons the initialized (a. beging, 07.02.2023)
///
protected override async Task OnInitializedAsync()
{
await AuthService.Initialize();
await base.OnInitializedAsync();
}
#endregion
}
}