{% extends 'mails/base.twig' %}

{% block content %}
    <mj-section background-color="#ffffff" padding-bottom="20px" padding-top="20px">
        <mj-column width="100%">
            <mj-text align="center" font-size="20px" font-weight="900" font-family="Helvetica, Arial, sans-serif" text-transform="uppercase" letter-spacing="1px">
                Rapport de Sauvegarde
            </mj-text>

            <mj-text align="center" color="{{ datas.backup.status == 'SUCCESS' ? '#10b981' : '#ef4444' }}" font-size="16px" font-weight="bold">
                Statut : {{ datas.backup.status == 'SUCCESS' ? 'OPÉRATION RÉUSSIE ✅' : 'ÉCHEC DÉTECTÉ ❌' }}
            </mj-text>

            <mj-table padding="20px 40px">
                <tr style="border-bottom:1px solid #ecedee;text-align:left;padding:15px 0;">
                    <th style="padding: 10px 0; color: #4b5563;">Date</th>
                    <td style="padding: 10px 0; text-align: right; font-weight: bold;">{{ datas.backup.createdAt|date('d/m/Y H:i') }}</td>
                </tr>
                {% if datas.backup.status == 'SUCCESS' %}
                    <tr style="border-bottom:1px solid #ecedee;text-align:left;padding:15px 0;">
                        <th style="padding: 10px 0; color: #4b5563;">Taille de l'archive</th>
                        <td style="padding: 10px 0; text-align: right; font-weight: bold; color: #2563eb;">{{ datas.backup.sizeMb }} MB</td>
                    </tr>
                {% endif %}
                <tr style="border-bottom:1px solid #ecedee;text-align:left;padding:15px 0;">
                    <th style="padding: 10px 0; color: #4b5563;">ID Log</th>
                    <td style="padding: 10px 0; text-align: right; font-family: monospace;">#{{ datas.backup.id }}</td>
                </tr>
            </mj-table>

            {% if datas.backup.status == 'ERROR' %}
                <mj-text background-color="#fef2f2" color="#991b1b" padding="20px" font-family="monospace" font-size="12px" border-radius="8px">
                    <strong>Message d'erreur :</strong><br/>
                    {{ datas.backup.errorMessage }}
                </mj-text>
            {% endif %}
        </mj-column>
    </mj-section>
{% endblock %}
