{% component_block "modal" id="modal_leave_team" start_open="true" title="Leave Team" %}
{% fill "content" %}
<form class="py-4"
      id="modal_leave_team-form"
      hx-post="{% url 'core:api:teams:leave confirm' team_id=team.id %} "
      hx-swap="none">
    {% csrf_token %}
    <div class="form-control">
        <p class="text-lg font-bold">Are you sure you would like to leave {{ team.name }}?</p>
    </div>
    <div class="modal-action">
        <button type="submit"
                id="modal_leave_team-submit"
                class="btn btn-primary"
                x-on:leave_team_error.window="document.getElementById('modal_leave_team').close()">
            Leave Team
        </button>
        <button type="button" _="on click call #modal_leave_team.close()" class="btn">Cancel</button>
    </div>
</form>
{% endfill %}
{% endcomponent_block %}
