<div class="p-3 mt-3 border-top">
    <table class="table table-striped table-sm table-bordered">
        @if($patient->smses && count($patient->smses))
            <thead>
            <tr>
                <th class="px-2 text-secondary border-bottom-0 text-nowrap">Date &amp; Time</th>
                <th class="px-2 text-secondary border-bottom-0 w-25">Type</th>
                <th class="px-2 text-secondary border-bottom-0 w-25">From</th>
                <th class="px-2 text-secondary border-bottom-0 w-25">To</th>
                <th class="px-2 text-secondary border-bottom-0 w-50">Content</th>
            </tr>
            </thead>
            <tbody>
            @foreach($patient->smses as $sms)
                <tr>
                    <td class="px-2 text-nowrap">{{ friendly_date_time($sms->created_at) }}</td>
                    <td class="px-2">{{ ucwords($sms->incoming_or_outgoing) }}</td>
                    <td class="px-2">{{ $sms->from_number }}</td>
                    <td class="px-2">{{ $sms->to_number }}</td>
                    <td class="px-2">{{ $sms->body }}</td>
                </tr>
            @endforeach
            </tbody>
        @else
            <tbody>
            <tr>
                <td class="text-secondary p-3">No messages for this patient</td>
            </tr>
            </tbody>
        @endif
    </table>
</div>
