{% component_block "modal" id="modal_invite_user" start_open="true" title="Invite User" %}
{% fill "content" %}
<form class="py-4"
      id="modal_invite_user-form"
      hx-post="{% url 'core:api:teams:invite' %}"
      hx-swap="none">
    {% csrf_token %}
    <div class="form-control w-full">
        <label class="label justify-start">
            Users' Email
            <span class="required_star">*</span>
        </label>
        <input id="modal_input-email"
               name="email"
               type="email"
               class="input input-block input-bordered"
               required>
    </div>
    <input type="hidden" name="team_id" value="{{ team_id }}">
    <div class="modal-action">
        <button type="submit"
                id="modal_invite_user-submit"
                class="btn btn-primary"
                x-on:invite_user_error.window="document.getElementById('modal_invite_user').close()">
            Send Invite
        </button>
        <button type="button"
                _="on click call #modal_invite_user.close()"
                class="btn">Cancel</button>
    </div>
</form>
{% endfill %}
{% endcomponent_block %}
