{% extends "partials/_generic_modal.html" %}

{% block modal_id %}create-api-key-modal{% endblock %}
{% block modal_event_id %}create-api-key-modal{% endblock %}
{% block modal_event_id_close %}create-api-key-modal{% endblock %}

{% block modal_header %}{% endblock %}

{% block modal_icon_bg %}bg-blue-100{% endblock %}
{% block modal_icon_color %}text-blue-600{% endblock %}
{% block modal_icon %}
<i aria-hidden="true" data-lucide="key-round" class="h-6 w-6"></i>
{% endblock %}

{% block modal_body_title %}
<h3 class="text-lg leading-6 font-medium text-gray-900" id="modal-title-body">
  Create New API Key
</h3>
{% endblock %}

{% block modal_content_margin %}sm:ml-4{% endblock %}

{% block modal_body %}
{% include "partials/_api_key_form.html" %}
<!-- Fire the event once the modal fragment is attached -->
<div x-init="$nextTick(() => { $dispatch('open-modal', { id: 'create-api-key-modal' }); $el.remove(); })"></div>
{% endblock %}

{% block modal_footer %}
<button type="submit"
        form="create-api-key-form"
        class="inline-flex w-full justify-center rounded-md border border-transparent bg-blue-600 px-4 py-2 text-base font-medium text-white shadow-sm hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 sm:ml-3 sm:w-auto sm:text-sm">
  Create Key
</button>
<button type="button"
        x-on:click="$dispatch('close-modal', { id: 'create-api-key-modal' })"
        class="mt-3 inline-flex w-full justify-center rounded-md border border-gray-300 bg-white px-4 py-2 text-base font-medium text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm">
  Cancel
</button>
{% endblock %}
