<div class="form-group bg-info text-white p-2">
    <label>Kategoria</label>
    <select [(ngModel)]="highlightCategory" class="form-control">
        <option value="">Brak</option>
        <option *ngFor="let category of categories">
            {{category}}
        </option>
    </select>
</div>
<table class="table table-sm table-bordered table-striped">
    <tr>
        <th>ID</th><th>Produkt</th><th>Kategoria</th><th>Cena</th><th></th>
    </tr>
    <tr *ngFor="let item of getProducts()"
            [@rowHighlight]="getRowState(item.category)">
        <td>{{item.id}}</td>
        <td>{{item.name}}</td>
        <td>{{item.category}}</td>
        <td>{{item.price | currency:"PLN":"symbol":undefined:"pl-PL" }}</td>
        <td class="text-center">
            <button class="btn btn-danger btn-sm mr-1" (click)="deleteProduct(item.id)">
                Usuń
            </button>
            <button class="btn btn-warning btn-sm"
                [routerLink]="['/form', 'edit', item.id]">
                Edytuj
            </button>
        </td>
    </tr>
</table>

<div class="p-2 text-center">
    <button class="btn btn-primary m-1" routerLink="/form/create">
        Dodaj nowy produkt
    </button>
</div>
