@model PlanTempus.Application.Features.Suppliers.Components.SupplierTableViewModel

<swp-action-bar>
    <swp-search-input>
        <i class="ph ph-magnifying-glass"></i>
        <input type="text" id="supplierSearchInput" placeholder="@Model.SearchPlaceholder" />
    </swp-search-input>
    <swp-btn-group>
        <swp-btn class="secondary">
            <i class="ph ph-export"></i>
            <span>@Model.ExportButtonText</span>
        </swp-btn>
        <swp-btn class="primary">
            <i class="ph ph-plus"></i>
            <span>@Model.CreateButtonText</span>
        </swp-btn>
    </swp-btn-group>
</swp-action-bar>

<swp-card class="suppliers-list">
    <swp-data-table>
        <swp-data-table-header>
            <swp-data-table-cell>@Model.ColumnSupplier</swp-data-table-cell>
            <swp-data-table-cell>@Model.ColumnContact</swp-data-table-cell>
            <swp-data-table-cell>@Model.ColumnProducts</swp-data-table-cell>
            <swp-data-table-cell>@Model.ColumnLastOrder</swp-data-table-cell>
            <swp-data-table-cell>@Model.ColumnStatus</swp-data-table-cell>
        </swp-data-table-header>
        @foreach (var supplier in Model.Suppliers)
        {
            @await Component.InvokeAsync("SupplierRow", supplier)
        }
    </swp-data-table>

    <swp-empty-state id="supplierEmptyState" style="display: none;">
        <i class="ph ph-package"></i>
        <span>@Model.EmptySearchText</span>
    </swp-empty-state>
</swp-card>
