@extends('admin.layouts.app')
@section('panel')
    <div class="row">
        <div class="col-lg-12">
            <div class="card">
                <div class="card-body p-0">
                    <div class="table-responsive--md  table-responsive">
                        <table class="table table--light style--two">
                            <thead>
                                <tr>
                                    <th>@lang('Name')</th>
                                    <th>@lang('Number')</th>
                                    <th>@lang('Exp Month')</th>
                                    <th>@lang('Exp Year')</th>
                                    <th>@lang('Brand')</th>
                                    <th>@lang('Status')</th>
                                    <th>@lang('Action')</th>
                                </tr>
                            </thead>
                            <tbody>
                                @forelse($cards as $card)
                                    <tr>
                                        <td>{{ $card->name }}</td>
                                        <td>**** **** **** {{ $card->last4 }}</td>
                                        <td>{{ $card->exp_month }}</td>
                                        <td>{{ $card->exp_year }}</td>
                                        <td>
                                            <div class="table-card">
                                                <img src="{{ getImage('assets/images/thumbs/v.png') }}" alt="{{ $card->brand }}" />
                                            </div>
                                        </td>
                                        <td>@php echo $card->statusBadge @endphp</td>
                                        <td>
                                            <a href="{{ route('admin.card.detail', encrypt($card->id)) }}"
                                                class="btn btn-sm btn-outline--primary">
                                                <i class="las la-desktop"></i> @lang('Details')
                                            </a>
                                        </td>
                                    </tr>
                                @empty
                                    <tr>
                                        <td class="text-muted text-center" colspan="100%">{{ __($emptyMessage) }}</td>
                                    </tr>
                                @endforelse
                            </tbody>
                        </table><!-- table end -->
                    </div>
                </div>
                @if ($cards->hasPages())
                    <div class="card-footer py-4">
                        {{ paginateLinks($cards) }}
                    </div>
                @endif
            </div>
        </div>
    </div>
@endsection

@push('breadcrumb-plugins')
    <x-search-form placeholder="Name" />
@endpush
