{% extends "admin.html.twig" %}

{% block adminContent %}
    <div class="d-flex align-items-center gap-3 mb-2">
        {% if definition.logo %}
            <img src="{{ asset(definition.logo) }}" alt="{{ definition.name }}" style="width: 48px; height: 48px; object-fit: contain;">
        {% endif %}
        <div>
            <h1 class="mb-0">{{ definition.name }}</h1>
            <p class="text-body-secondary mb-0">{{ definition.description|trans }}</p>
        </div>
    </div>

    <div class="mb-3">
        <a href="{{ definition.homepage }}" target="_blank" rel="noopener noreferrer" class="small">
            <i class="fa fa-external-link me-1"></i>
            {{ 'admin.webhook.predefined.homepage'|trans }}
        </a>
    </div>

    {% include 'flashMessages.html.twig' %}

    {{ form_start(form) }}

        {{ form_row(form.name) }}
        {{ form_row(form.accessToken) }}
        {{ form_row(form.enabled) }}

        <div class="d-flex mt-3">
            <button type="submit" class="btn btn-primary">
                <i class="fa fa-check"></i>
                {{ 'button.save'|trans }}
            </button>
            <a href="{{ path('admin_webhooks_new') }}" class="btn btn-link text-decoration-none ms-2">
                <i class="fa fa-chevron-left"></i>
                {{ 'button.back'|trans }}
            </a>
        </div>

    {{ form_end(form) }}
{% endblock %}
