<style>
    table {
        font-size: 10px;
        border-collapse: collapse;
        width: 100%;
        table-layout: fixed;
        word-wrap: break-word;
    }

    th,
    td {
        border: 1px solid black;
    }

    th,
    td {
        padding: 4px;
        text-align: left;
        /* border: 1px solid #ddd; */
    }

    th {
        text-align: left;
    }

    .page-break {
        page-break-after: always;
    }

    .header {
        font-size: 22px;
        text-align: center;
        margin-bottom: 20px;
    }

    .logo {
        width: 100px;
        height: 100px;
        margin: 0 auto;
    }
</style>

<div class="header">
    {{-- <img src="{{ asset('assets/images/logo.png') }}" alt="logo" class="logo"> --}}
    <h2>{{ $general->site_name }}</h2>
</div>

<h3>List Of Rewards</h3>

@php
    if (isset($rewards)) {
        $network = $rewards;
    }
@endphp

<table>
    <thead>
        <tr>
            <th>{{ trans('User ID') }}</th>
            <th>{{ trans('Name') }}</th>
            <th>{{ trans('Email') }}</th>
            <th>{{ trans('Mobile') }}</th>
            <th>{{ trans('Level') }}</th>
            <th>{{ trans('Reward') }}</th>
            <th>{{ trans('Amount') }}</th>
            <th>{{ trans('Charge') }}</th>
            <th>{{ trans('trx') }}</th>
            <th>{{ trans('Achieved at') }}</th>
        </tr>
    </thead>
    <tbody>
        @foreach ($network as $item)
            <tr>
                <td>{{ $item->user->system_id }}</td>
                <td>{{ $item->user->fullname }}</td>
                <td>{{ $item->user->email }}</td>
                <td><span>+</span>{{ $item->user->mobile }}</td>
                <td>{{ $item->rank }}</td>
                <td>{{ showAmount($item->prize) }}</td>
                <td>{{ ($item->transaction) ? showAmount($item->transaction->amount) : 'N/A' }}</td>
                <td>{{ ($item->transaction) ? showAmount($item->transaction->charge) : 'N/A' }}</td>
                <td>{{ ($item->transaction) ? ($item->transaction->trx) : 'N/A' }}</td>
                <td>{{ $item->status_changed_at ? $item->status_changed_at->format('d-M-Y') : 'N/A' }}</td>
            </tr>
        @endforeach
    </tbody>
</table>
