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

namespace Connected.Components;
public partial class Divider : UIComponent
{
   protected string Classname =>
   new CssBuilder("divider")
     .AddClass($"divider-absolute", Absolute)
     .AddClass($"divider-flexitem", FlexItem)
     .AddClass($"divider-light", Light)
     .AddClass($"divider-vertical", Vertical)
     .AddClass($"divider-{DividerType.ToDescription()}", when: () => DividerType != DividerType.FullWidth)
     .AddClass(AdditionalClassList)
   .Build();

   /// <summary>
   /// Sets absolute position to the component.
   /// </summary>
   [Parameter]
   [Category(CategoryTypes.Divider.Appearance)]
   public bool Absolute { get; set; }

   /// <summary>
   /// If true, a vertical divider will have the correct height when used in flex container.
   /// </summary>
   [Parameter]
   [Category(CategoryTypes.Divider.Appearance)]
   public bool FlexItem { get; set; }

   /// <summary>
   /// If true, the divider will have a lighter color.
   /// </summary>
   [Parameter]
   [Category(CategoryTypes.Divider.Appearance)]
   public bool Light { get; set; }

   /// <summary>
   /// If true, the divider is displayed vertically.
   /// </summary>
   [Parameter]
   [Category(CategoryTypes.Divider.Appearance)]
   public bool Vertical { get; set; }

   /// <summary>
   /// The Divider type to use.
   /// </summary>
   [Parameter]
   [Category(CategoryTypes.Divider.Appearance)]
   public DividerType DividerType { get; set; } = DividerType.FullWidth;
}
