@namespace Connected.Components
@inherits UIComponent
@typeparam T

<ToolBar @attributes="CustomAttributes" Class="@Classname">
    <div class="table-pagination-spacer"></div>
    @if (!DisableRowsPerPage)
    {
        <TextContent Typo="Typo.body2" Class="table-pagination-caption">
            @RowsPerPageString
        </TextContent>
        <Select T="string" ValueChanged="@SetRowsPerPageAsync" Value="@DataGrid?.RowsPerPage.ToString()" Class="table-pagination-select" DisableUnderLine="true" Dense="true" Disabled="@Disabled">
            @foreach (int pageSize in PageSizeOptions)
            {
                <SelectItem T="string" Value="@pageSize.ToString()">@pageSize.ToString().ToUpper()</SelectItem>
            }
        </Select>
    }
    <TextContent Typo="Typo.body2" Class="table-pagination-caption">
        @Info
    </TextContent>
    <div class="table-pagination-actions">
        <IconButton Class="flip-x-rtl" Icon="@Icons.Material.Filled.FirstPage" Disabled="@BackButtonsDisabled" @onclick="@(() => DataGrid.NavigateTo(Page.First))"/>
        <IconButton Class="flip-x-rtl" Icon="@Icons.Material.Filled.NavigateBefore" Disabled="@BackButtonsDisabled" @onclick="@(() => DataGrid.NavigateTo(Page.Previous))"/>
        <IconButton Class="flip-x-rtl" Icon="@Icons.Material.Filled.NavigateNext" Disabled="@ForwardButtonsDisabled" @onclick="@(() => DataGrid.NavigateTo(Page.Next))"/>
        <IconButton Class="flip-x-rtl" Icon="@Icons.Material.Filled.LastPage" Disabled="@ForwardButtonsDisabled" @onclick="@(() => DataGrid.NavigateTo(Page.Last))"/>
    </div>
</ToolBar>

