@extends('Template::layouts.master')
@section('content')
    <div class="dashboard-body">
        <div class="data-table">
            <div class="data-table__header">
                <h6 class="data-table__title">
                    {{ __($pageTitle) }}
                </h6>
            </div>
            <div class="data-table__body">
                @if (!$supports->isEmpty())
                    <div class="table--responsive">
                        <table class="table table--custom table--responsive-md">
                            <thead>
                                <tr>
                                    <th>@lang('Subject')</th>
                                    <th>@lang('Status')</th>
                                    <th>@lang('Priority')</th>
                                    <th>@lang('Last Reply')</th>
                                    <th>@lang('Action')</th>
                                </tr>
                            </thead>
                            <tbody>
                                @foreach ($supports as $support)
                                    <tr>
                                        <td data-label="Name">

                                            <a href="{{ route('ticket.view', $support->ticket) }}" class="fw-bold text--base">
                                                [@lang('Ticket')#{{ $support->ticket }}]
                                                {{ __($support->subject) }} </a>
                                        </td>
                                        <td data-label="Price">
                                            @php echo $support->statusBadge; @endphp
                                        </td>
                                        <td data-label="Win Status">
                                            @php echo $support->priorityBadge; @endphp
                                        </td>
                                        <td data-label="Status">
                                            {{ diffForHumans($support->last_reply) }}
                                        </td>
                                        <td data-label="Action">
                                            <a href="{{ route('ticket.view', $support->ticket) }}"
                                                class="btn btn--icon btn--sm btn--base-two">
                                                <i class="las la-desktop"></i>
                                            </a>
                                        </td>
                                    </tr>
                                @endforeach
                            </tbody>
                        </table>
                    </div>
                @else
                    @include('Template::partials.data_not_found', ['data' => 'No Bids Found'])
                @endif
            </div>
        </div>
        @if ($supports->hasPages())
            <div class="pagination-wrapper">
                {{ paginateLinks($supports) }}
            </div>
        @endif
    </div>
@endsection
