@namespace Connected.Components
@using Connected.Annotations;
@using Connected.Utilities
@using Connected.Extensions
@inherits UIComponent

<CascadingValue Value="this" IsFixed="true">
    <div @attributes="CustomAttributes" class="@Classname">
        @ChildContent
    </div>
</CascadingValue>

@code {

    protected string Classname =>
    new CssBuilder("grid")
      .AddClass($"grid-spacing-xs-{Spacing.ToString()}")
      .AddClass($"justify-{Justify.ToDescription()}")
      .AddClass(AdditionalClassList)
    .Build();

    [Parameter]
    [Category(CategoryTypes.Grid.Behavior)]
    public int Spacing { set; get; } = 3;
    
    [Parameter]
    [Category(CategoryTypes.Grid.Behavior)]
    public Justify Justify { get; set; } = Justify.FlexStart;
    
    [Parameter]
    [Category(CategoryTypes.Grid.Behavior)]
    public RenderFragment ChildContent { get; set; }

}