using System;

using CommonHelpers.WASM;
using AFXUI;

namespace BookRegistry.Client {

//*************************************************************************************************
class ErrorMI: NavMenuItem {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

public static ErrorMI Item { get; private set; } = new ErrorMI();

public static string HTML() => string.Format(
   "<div id=\"magistral_MI_ErrorDIV\">{0}</div>",
   UpdateItem().PrepareItemHtml() );
public static void ApplyToUI()
{
   UpdateItem().Magistral_SetPageNameAndIcon();
   UMagistralMI.SetInnerHtml( "magistral_MI_ErrorDIV", Item.PrepareItemHtml() );
}
public static ErrorMI UpdateItem() => Item = new ErrorMI();

public ErrorMI()
{
   ID = "magistral_MI_ErrorA";
   HRef = "/error";
   PageName = "Error";
   Title = "Application error-info&#xA;(Error description page)";
   IconPath = "images/nav_menu/error.png";
   CaptionHtml =
      (UBreakdown.HasErrorInfo ? $"<img src='{IconPath}' />&nbsp;&nbsp;" : "")+
      "App.error info (last error)";
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
} // ErrorMI
//**************************************************************************************************

} // BookRegistry.Client
