{# Scan repairs area for email reports #}
{# Receives: scan_repairs (associative array keyed by event slug), strings #}

{% for event_key, data in scan_repairs %}
	{% if data.count|default(0) > 0 %}
		<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">
			<tr>
				<td style="padding: 10px 4px 4px; font-size: 12px; font-weight: 600; color: #555555; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;">
					{{ data.name }}
					<span style="display: inline-block; padding: 1px 6px; font-size: 9px; font-weight: 600; background: #d1e7dd; color: #0a5c36; border-radius: 8px; margin-left: 4px; vertical-align: middle;">{{ data.count }}</span>
				</td>
			</tr>
		</table>
		{% if data.repairs|length > 0 %}
			<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="border-collapse: collapse;">
				{% for path in data.repairs %}
					<tr>
						<td style="padding: 3px 4px 3px 12px; font-family: monospace; font-size: 11px; color: #555555; border-left: 3px solid #008000; border-bottom: 1px solid {{ loop.last ? '#d9dfd9' : '#f0f0f0' }};">
							&#10003; {{ path }}
						</td>
					</tr>
				{% endfor %}
			</table>
		{% endif %}
	{% endif %}
{% endfor %}
