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

namespace Connected.Components;
public partial class Grid: ComponentBase
{
	public List<GridRow> Rows { get; set; } = new();
	
	[Parameter]
	public RenderFragment? ChildContent { get; set; }

	[Parameter]
	public bool Dense { get; set; } = true;

	[Parameter]
	public bool ContainsImage { get; set; } = true;

	[Parameter]
	public bool ShowSelect { get; set; } = true;

	[Parameter]
	public bool Collapsable { get; set; } = true;

	[Parameter]
	public string Class { get; set; } = string.Empty;

	private string GridClass
	{
		get
		{
			return new CssBuilder("data-grid")
				.AddClass("dense", Dense)
				.AddClass("image", ContainsImage)
				.AddClass("select", ShowSelect)
				.AddClass("collapse", Collapsable)
				.AddClass(Class)
				.Build();
		}
	}
}
