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

{% block title %}Voir le Message{% endblock %}

{% block body %}
    <div class="container mx-auto p-6">
        <h1 class="text-3xl font-bold mb-6 text-center">Message de {{ message.sender.nickname }}</h1>

        <div class="max-w-lg mx-auto bg-white p-6 rounded-lg shadow">
            <div class="mb-4">
                <p class="text-gray-700"><strong>De :</strong> {{ message.sender.nickname }}</p>
                <p class="text-gray-700"><strong>Reçu le :</strong> {{ message.sendingDate|date('d/m/Y H:i') }}</p>
            </div>

            <div class="bg-gray-100 p-4 rounded mb-6">
                <p class="text-gray-800 whitespace-pre-line">{{ message.content }}</p>
            </div>

            <!-- Bouton pour répondre -->
            <div class="text-center">
                <a href="{{ path('app_message_new', {'receiver': message.sender.id}) }}"
                   class="bg-teal-500 text-white px-6 py-2 rounded hover:bg-teal-600">
                    Répondre
                </a>
            </div>
        </div>
    </div>
{% endblock %}