<x-layouts.email title="Tracking Updated">
    <p>Dear {{ $tracking->shipment->receiver_name }},</p>
    <p>We are excited to inform you that your shipment tracking has been updated. Here are the details:</p>

    <table>
        <tr>
            <th>Tracking Status</th>
            <td>{{ status($tracking->status_code) }}</td>
        </tr>

        @if ($tracking->status_code == 0)
        <tr>
            <th>Hold Reason</th>
            <td>{{ $tracking->hold_reason }}</td>
        </tr>
        @endif
        <tr>
            <th>Date Sent</th>
            <td>{{ $tracking->date_sent->format('d/m/Y') }}</td>
        </tr>
        <tr>
            <th>Delivery Date</th>
            <td>{{ $tracking->date_expected->format('d/m/Y') }}</td>
        </tr>

        <tr>
            <th>Progress</th>
            <td>{{ $tracking->progress }}%</td>
        </tr>

        <tr>
            <th>Current Location</th>
            <td>{{ $tracking->current_location }}</td>
        </tr>
        <tr>
            <th>Tracking Code</th>
            <td>{{ $tracking->shipment->tracking_code }}</td>
        </tr>
    </table>
</x-layouts.email>