@extends('admin.layout.main')
@section('content')
    <div class="main-content">
        <section class="section">
            <div class="section-header">
                <h1>History Refund</h1>
                <div class="section-header-breadcrumb">
                    <div class="breadcrumb-item active"><a href="{{route('index')}}">Dashboard</a></div>
                    <div class="breadcrumb-item">Refund</div>
                    <div class="breadcrumb-item">History</div>
                </div>
            </div>
            <div class="col-12">
                <div class="card">
                    <div class="card-body">
                        <div class="table-responsive">
                            <table class="table table-striped" id="table-2">
                                <thead>
                                    <tr>
                                        <th class="text-center">
                                            #
                                        </th>
                                        <th>Order ID</th>
                                        <th>Customer</th>
                                        <th>Seller</th>
                                        <th>Total</th>
                                        <th>Due Date</th>
                                        <th>Status</th>
                                        <th>Action</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    @foreach ($refunds as $refund)
                                        <tr>
                                            <td>{{ $loop->iteration }}</td>
                                            <td class="font-weight-600">{{ $refund->orderId }}</a></td>
                                            <td class="font-weight-600">{{ $refund['customer'] }}</td>
                                            <td class="font-weight-600">{{ $refund['seller'] }}</td>
                                            <td class="font-weight-600">{{ $refund['total'] }}</td>
                                            <td>{{ $refund['date'] }}</td>
                                            <td>
                                                <div class="badge {{ $refund->status == 'Partial Refund' ? 'badge-succes' : ($refund->status == 'Pending' ? 'badge-info' : 'badge-warning') }}">{{ $refund->status }}</div>
                                            </td>
                                            <td>
                                                <div class="btn-group">
                                                    <button type="button" class="btn btn-primary dropdown-toggle"
                                                        data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                                        Action
                                                    </button>
                                                    <div class="dropdown-menu">
                                                        <a class="dropdown-item" href="/detail_refund">Details</a>
                                                        <a class="dropdown-item" href="#">Delete</a>
                                                    </div>
                                                </div>
                                            </td>
                                        </tr>
                                    @endforeach
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        @endsection