using Connected.Annotations;
using Connected.Extensions;
using Connected.Utilities;
using Microsoft.AspNetCore.Components;

namespace Connected.Components;

public partial class NavMenu : UIComponent
{
	protected string Classname =>
	new CssBuilder("navmenu")
		.AddClass($"navmenu-{Color.ToDescription()}")
		.AddClass($"navmenu-margin-{Margin.ToDescription()}")
		.AddClass("navmenu-dense", Dense)
		.AddClass("navmenu-rounded", Rounded)
		.AddClass($"navmenu-bordered mud-border-{Color.ToDescription()}", Bordered)
		.AddClass(AdditionalClassList)
	.Build();

	[Category(CategoryTypes.NavMenu.Behavior)]
	[Parameter] public RenderFragment ChildContent { get; set; }

	/// <summary>
	/// The color of the active NavLink.
	/// </summary>
	[Parameter]
	[Category(CategoryTypes.NavMenu.Appearance)]
	public ThemeColor Color { get; set; } = ThemeColor.Default;

	/// <summary>
	/// If true, adds a border of the active NavLink, does nothing if variant outlined is used.
	/// </summary>
	[Parameter]
	[Category(CategoryTypes.NavMenu.Appearance)]
	public bool Bordered { get; set; }

	/// <summary>
	/// If true, default theme border-radius will be used on all navlinks.
	/// </summary>
	[Parameter]
	[Category(CategoryTypes.NavMenu.Appearance)]
	public bool Rounded { get; set; }

	/// <summary>
	///  Adjust the vertical spacing between navlinks.
	/// </summary>
	[Parameter]
	[Category(CategoryTypes.NavMenu.Appearance)]
	public Margin Margin { get; set; } = Margin.None;

	/// <summary>
	/// If true, compact vertical padding will be applied to all navmenu items.
	/// </summary>
	[Parameter]
	[Category(CategoryTypes.NavMenu.Appearance)]
	public bool Dense { get; set; }

}
