using Core.DomainObjects;

namespace WeatherForecast.Models {

  /// <summary>
  /// 
  /// </summary>
  public class MenuItemModel {

    /// <summary>
    /// 
    /// </summary>
    public string? Icon { get; set; }

    /// <summary>
    /// 
    /// </summary>
    public string? Title { get; set; }

    /// <summary>
    /// 
    /// </summary>
    public string? Target { get; set; }

    /// <summary>
    /// 
    /// </summary>
    public List<MenuItemModel>? ChildItems { get; set; }

    /// <summary>
    /// 
    /// </summary>
    /// <param name="menuItem"></param>
    public MenuItemModel(MenuItem menuItem) {
      Title = menuItem.Title;
      Target = menuItem.Target;
      ChildItems = menuItem.ChildItems?.Select(x => new MenuItemModel(x)).ToList();
    }
  }
}
