{% extends 'user/layout.html.twig' %}

{% block profile_content %}

    {% import "user/actions.html.twig" as actions %}
    {% set event = actions(app.user, 'user_forms', tab, {'user': user}) %}

    <div class="card">
        <div class="card-header">
            <ul class="nav nav-pills card-header-pills" data-bs-toggle="tabs">
                {% for name, settings in event.actions %}
                    <li class="nav-item" role="presentation">
                        <a href="{{ settings.url }}" class="nav-link{% if tab == name %} active{% endif %}" role="tab">{{ settings.title|trans({}, settings.translation_domain ?? 'messages') }}</a>
                    </li>
                {% endfor %}
            </ul>
        </div>
        {% block form_body %}
        {{ form_start(form) }}
        <div class="card-body {% block form_body_class %}{% endblock %}">
            {% block form_pre_content %}{% endblock %}
            {% block form_content %}
                {{ form_widget(form) }}
            {% endblock %}
            {% block form_post_content %}{% endblock %}
        </div>
        <div class="card-footer">
            <input type="submit" value="{{ 'action.save'|trans }}" class="btn btn-primary" />
        </div>
        {{ form_end(form) }}
        {% endblock %}
    </div>

{% endblock %}
