{% extends 'base.html.twig' %}

{% block title %}Liste des Candidatures{% endblock %}

{% block body %}
<h2 class="text-2xl font-bold mb-6">Candidatures reçues</h2>

{% for app in applications %}
    <div class="border border-gray-300 rounded-lg p-4 mb-4 shadow-sm bg-white">
        <p><strong>Annonce :</strong> {{ app.application.title }}</p>
        <p><strong>Candidat :</strong> {{ app.intern.firstName }} {{ app.intern.lastName }}</p>
        <p><strong>Date :</strong> {{ app.applicationDate|date('d/m/Y') }}</p>
        <p><strong>Statut :</strong> {{ app.status }}</p>

        <a href="{{ path('app_profile_visit', { id: app.intern.id }) }}"
           class="inline-block mt-2 bg-teal-500 hover:bg-teal-600 text-white px-4 py-2 rounded">
            Voir le profil du candidat
        </a>
    </div>
{% else %}
    <p>Aucune candidature pour le moment.</p>
{% endfor %}

{% endblock %}
