@extends('app.my-account.admin.users.single')

@section('details')
    <div class="my-4">
        <div class="d-flex align-items-center justify-content-between">
            <h4 class="m-0"><b>SMSes Sent</b></h4>  
            <div>
                @include('app.my-account.admin.users.forms.create-sms')
            </div>
        </div>
        
        <div class="table-responsive">
            <table class="table table-sm table-hover table-striped table-bordered mb-0">
                <thead>
                    <tr>
                        <th>Sent At</th>
                        <th>From</th>
                        <th>To</th>
                        <th>Text</th>
                    </tr>
                </thead>
                <tbody>
                    @foreach ($smsesSent as $sms)
                        <tr>
                            <td>{{ friendly_date($sms->created_at) }}</td>
                            <td><?= $sms->from ?></td>
                            <td><?= $sms->to ?></td>
                            <td><?= nl2br($sms->content) ?></td>
                        </tr>
                    @endforeach
                    @if(!count($smsesSent))
                        <tr>
                            <td colspan="4">No SMSes sent!</td>
                        </tr>
                    @endif
                </tbody>
            </table>
        </div>
    </div>
@endsection
