@namespace Oqtane.Modules.Admin.Error
@inherits ModuleBase
@inject IModuleService ModuleService
@inject IStringLocalizer<Index> Localizer

@code {
    public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Anonymous;

    protected override async Task OnInitializedAsync()
    {
        Module module = await ModuleService.GetModuleAsync(ModuleState.ModuleId);
        if (UserSecurity.IsAuthorized(PageState.User, RoleNames.Host))
        {
			AddModuleMessage(string.Format(Localizer["Error.Module.Load"], module.ModuleDefinitionName), MessageType.Error);
        }

        await logger.LogCritical("Error Loading Module {Module}", module);
    }
}
