<div class="container-xxl flex-grow-1 container-p-y">
    
    <div class="row mx-1 my-1">
        <div class="col-md-9">
            <h4 class="fw-bold py-3 mb-4">Job <span class="text-muted fw-light">/ Detail</span></h4>
        </div>
    </div>

    <div class="row mx-1 my-1">
        
        <div class="card">
            <div class="card-body">
                @include('admin.partials.company-overview', array('company' => $job->company))
                
                <hr>
                <div class="table-responsive text-wrap mt-4">
                    <h4><strong>Job Detail</strong></h4>
                    <table class="table">
                        <tr>
                            <th>ID</th>
                            <td>{{ $job->id ?? "" }}</td>
                            <th>Title</th>
                            <td>{{ $job->title ?? "" }}</td>
                        </tr>
                        <tr>
                            <th>Email</th>
                            <td>{{ $job->email ?? "" }}</td>
                            <th>Posted on</th>
                            <td>{{ $job->created_at->format('d M, Y') ?? "" }}</td>
                        </tr>
                        <tr>
                            <th>Type</th>
                            <td>{{ $job->type ?? "" }}</td>
                            <th>Location</th>
                            <td>{{ $job->location ?? "N/A" }}</td>
                        </tr>
                        {{-- <tr>
                            <th>Salary</th>
                            <td colspan="3">{{$job->currency ?? '$'}} {{$job->min_salary > 0 ? ($job->min_salary.' - ') : ''}}{{$job->max_salary}}<span>/year</span></td>
                        </tr> --}}
                        <tr>
                            <th>Description</th>
                            <td colspan="3">{{ $job->description ?? "" }}</td>
                        </tr>
                        <tr>
                            <th>Roles and Responsiblity</th>
                            <td colspan="3">{{ $job->roles ?? "" }}</td>
                        </tr>
                        <tr>
                            <th>How to Apply</th>
                            <td colspan="3">{{ $job->how_to_apply ?? "" }}</td>
                        </tr>
                    </table>   
                </div>
            </div>
        </div>
    </div>

    <div class="row mt-4 mx-1 my-1">
        <div class="card">
            <div class="card-body">
                <h4 class="fw-bold "><span class="text-muted fw-light"></span> Applicants</h4>
                <div class="table-responsive text-nowrap">
                    <table class="table table-hover">
                    <thead>
                        <tr>
                            <th>Image</th>
                            <th>Name</th>
                            <th>Email</th>
                            <th>Message</th>
                            <th>File</th>
                        </tr>
                    </thead>
                    @if (isset($applicants) && count($applicants) > 0)
                    <tbody class="table-border-bottom-0">
                        @foreach ($applicants as $applicant)
                            <tr>
                                <td>
                                    <img src="{{$applicant->user->company?->logo}}" class="listing-img"/>
                                </td>
                                <td>{{$applicant->name}}</td>
                                <td>{{$applicant->email}}</td>
                                <td>{{$applicant->message}}</td>
                                <td><a href="{{$applicant->file}}" download>
                                    Download</a>
                                </td>
                                
                            </tr>
                        @endforeach
                    </tbody>
                    @else
                        <td colspan="8" class="text-center">No record found</td>
                    @endif
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>