{% load django_ledger %}
{% load i18n %}
<div class="table-container">
    <table class="table is-fullwidth is-narrow is-striped is-bordered django-ledger-table-bottom-margin-75">
        <thead>
            <tr>
                <th>Item</th>
                <th>UOM</th>
                <th>SKU</th>
                <th>UPC</th>
                <th>Earnings Account</th>
                <th>Actions</th>
            </tr>
        </thead>
        <tbody>
            {% for pns in pns_list %}
                <tr>
                    <td>{{ pns.name }}</td>
                    <td>{{ pns.uom }}</td>
                    <td>{{ pns.sku }}</td>
                    <td>{{ pns.upc }}</td>
                    <td>
                        {{ pns.earnings_account }}
                    </td>
                    <td>
                        <div class="dropdown is-right is-hoverable" id="invoice-action-{{ invoice.uuid }}">
                            <div class="dropdown-trigger">
                                <button class="button is-small is-rounded is-outlined is-dark"
                                        aria-haspopup="true"
                                        aria-controls="dropdown-menu">
                                    <span>
                                        Actions
                                    </span>
                                    <span class="icon is-small">{% icon 'bi:arrow-down' 24 %}</span>
                                </button>
                            </div>
                            <div class="dropdown-menu" id="dropdown-menu-{{ pns.uuid }}" role="menu">
                                <div class="dropdown-content">
                                    <a href="{% url 'django_ledger:product-update' entity_slug=entity_slug item_pk=pns.uuid %}"
                                       class="dropdown-item has-text-success">
                                        {% trans 'Update' %}
                                    </a>
                                </div>
                            </div>
                        </div>
                    </td>
                </tr>
            {% endfor %}
        </tbody>
    </table>
</div>
