<div class="container-fluid">
    <div class="d-flex justify-content-between align-items-center mb-3">
        <h2 class="mb-0">Ürün Etiketleri</h2>
        <div class="d-flex gap-2 align-items-center">
            <a href="/admin/product-tags/new" class="btn btn-sm btn-primary">Yeni Etiket</a>
            <div class="btn-group">
                <a href="/admin/content/product-tags"
                    class="btn btn-sm btn-outline-primary {{ if not .ShowDeleted }}active{{ end }}">Aktif</a>
                <a href="/admin/content/product-tags?deleted=true"
                    class="btn btn-sm btn-outline-danger {{ if .ShowDeleted }}active{{ end }}">Silinenler</a>
            </div>
        </div>
    </div>

    <div class="card border-0 shadow-sm">
        <div class="card-body p-3">
            <div class="table-responsive">
                <table class="table table-hover table-sm align-middle">
                    <thead class="bg-transparent text-muted small">
                        <tr>
                            <th>İsim</th>
                            <th class="text-muted">Oluşturma</th>
                            <th class="text-end text-muted">İşlemler</th>
                        </tr>
                    </thead>
                    <tbody>
                        {{ if .Tags }}
                        {{ range .Tags }}
                        <tr>
                            <td class="fw-semibold">{{ .Name }}</td>
                            <td class="text-muted small">{{ .CreatedAt.Format "2006-01-02" }}</td>
                            <td class="text-end">
                                <div class="btn-group" role="group">
                                    {{ if $.ShowDeleted }}
                                    <form action="/admin/product-tags/{{ .ID }}/restore" method="POST">
                                        <button class="btn btn-sm btn-success" title="Geri Yükle"><i
                                                class="bi bi-arrow-counterclockwise"></i></button>
                                    </form>
                                    {{ else }}
                                    <a href="/admin/product-tags/{{ .ID }}/edit"
                                        class="btn btn-sm btn-outline-secondary" title="Düzenle"><i
                                            class="bi bi-pencil"></i></a>
                                    <form action="/admin/product-tags/{{ .ID }}/delete" method="POST"
                                        onsubmit="return confirmDelete(event, this);">
                                        <button class="btn btn-sm btn-outline-danger" title="Sil"><i
                                                class="bi bi-trash"></i></button>
                                    </form>
                                    {{ end }}
                                </div>
                            </td>
                        </tr>
                        {{ end }}
                        {{ else }}
                        <tr>
                            <td colspan="3" class="text-center text-muted py-4">Kayıt yok</td>
                        </tr>
                        {{ end }}
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>