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

namespace Connected.Components;

public partial class SimpleTable : UIComponent
{
   protected string Classname =>
   new CssBuilder("table mud-simple-table")
      .AddClass($"table-dense", Dense)
      .AddClass($"table-hover", Hover)
      .AddClass($"table-bordered", Bordered)
      .AddClass($"table-outlined", Outlined)
      .AddClass($"table-striped", Striped)
      .AddClass($"table-square", Square)
      .AddClass($"table-sticky-header", FixedHeader)
      .AddClass($"elevation-{Elevation}", !Outlined)
     .AddClass(AdditionalClassList)
   .Build();

   /// <summary>
   /// Child content of component.
   /// </summary>
   [Parameter]
   [Category(CategoryTypes.SimpleTable.Appearance)]
   public int Elevation { set; get; } = 1;

   /// <summary>
   /// If true, the table row will shade on hover.
   /// </summary>
   [Parameter]
   [Category(CategoryTypes.SimpleTable.Appearance)]
   public bool Hover { get; set; }

   /// <summary>
   /// If true, border-radius is set to 0.
   /// </summary>
   [Parameter]
   [Category(CategoryTypes.SimpleTable.Appearance)]
   public bool Square { get; set; }

   /// <summary>
   /// If true, compact padding will be used.
   /// </summary>
   [Parameter]
   [Category(CategoryTypes.SimpleTable.Appearance)]
   public bool Dense { get; set; }

   /// <summary>
   /// If true, table will be outlined.
   /// </summary>
   [Parameter]
   [Category(CategoryTypes.SimpleTable.Appearance)]
   public bool Outlined { get; set; }

   /// <summary>
   /// If true, table's cells will have left/right borders.
   /// </summary>
   [Parameter]
   [Category(CategoryTypes.SimpleTable.Appearance)]
   public bool Bordered { get; set; }

   /// <summary>
   /// If true, striped table rows will be used.
   /// </summary>
   [Parameter]
   [Category(CategoryTypes.SimpleTable.Appearance)]
   public bool Striped { get; set; }

   /// <summary>
   /// When true, the header will stay in place when the table is scrolled. Note: set Height to make the table scrollable.
   /// </summary>
   [Parameter]
   [Category(CategoryTypes.SimpleTable.Appearance)]
   public bool FixedHeader { get; set; }

   /// <summary>
   /// Child content of the component.
   /// </summary>
   [Parameter]
   [Category(CategoryTypes.SimpleTable.Behavior)]
   public RenderFragment ChildContent { get; set; }

}
