@namespace BootstrapBlazor.Components
@inherits BootstrapComponentBase

<nav @attributes="@AdditionalAttributes" aria-label="breadcrumb">
    <ol class="breadcrumb">
        <CascadingValue Value="this" IsFixed="true">
            @foreach (var item in Value)
            {
                @RenderItem(item)
            }
        </CascadingValue>
    </ol>
</nav>

@code {
    RenderFragment<BreadcrumbItem> RenderItem => item =>
    @<li class="@GetItemClassString(item)">
        @if (!string.IsNullOrEmpty(item.Url))
        {
            <a href="@item.Url">@item.Text</a>
        }
        else
        {
            @item.Text
        }
    </li>;
}
