{% comment %} Preview partial for parsed rows; includes a form to create users {% endcomment %}
<div id="cid-generate-preview" class="mt-2">
    <h6 class="small">Preview ({{ rows|length }} rows)</h6>
    <div class="table-responsive">
        <table class="table table-sm table-borderless">
            <thead>
                <tr><th>Name</th><th>Email</th></tr>
            </thead>
            <tbody>
                {% for r in rows %}
                    <tr><td>{{ r.name }}</td><td>{{ r.email }}</td></tr>
                {% endfor %}
            </tbody>
        </table>
    </div>

    <form method="post" hx-post="{% url 'generic:cid_group_create_bulk' group.pk %}" hx-target="#group-users-wrap" hx-swap="outerHTML">
        {% csrf_token %}
        <textarea name="rows" class="d-none">{{ original|escape }}</textarea>
        <button type="submit" class="btn btn-sm btn-primary">Create users and add to group</button>
    </form>
</div>
