@extends('student.layouts.app')
@section('title', 'Riwayat Tes Potensi Karier | Career Development and Consultation (CDC)')
@push('styles')
    <link href="{{ asset('assets/student/plugins/custom/datatables/datatables.bundle.css') }}" rel="stylesheet"
        type="text/css" />
@endpush
@section('header')
    <div class="py-5 toolbar py-lg-5" id="kt_toolbar">
        <div id="kt_toolbar_container" class="flex-wrap container-xxl d-flex flex-stack">
            <div class="page-title d-flex flex-column me-3">
                <h1 class="my-1 d-flex text-dark fw-bolder fs-3">Riwayat Tes Potensi Karier</h1>
                <ul class="my-1 text-gray-600 breadcrumb breadcrumb-dot fw-bold fs-7">
                    <li class="text-gray-600 breadcrumb-item">
                        <a href="{{ route('student.dashboard') }}" class="text-gray-600 text-hover-primary">Dashboard</a>
                    </li>
                    <li class="text-gray-600 breadcrumb-item">Riwayat</li>
                </ul>
            </div>
        </div>
    </div>
@endsection
@section('content')
    <div class="card">
        <div class="pt-4 card-body">
            <table class="table align-middle table-row-dashed fs-6 gy-5" id="myTable">
                <thead>
                    <tr class="text-start text-muted fw-bolder fs-7 text-uppercase gs-0">
                        <th class="min-w-25px">Nomor</th>
                        <th class="min-w-125px">Nama</th>
                        <th class="min-w-125px">Tipe Kepribadian</th>
                        <th class="min-w-125px">Tanggal Tes</th>
                        <th class="min-w-100px">Pengaturan</th>
                    </tr>
                </thead>
                <tbody class="text-gray-600 fw-bold">
                    @foreach ($results as $index => $result)
                        <tr>
                            <td>{{ $index + 1 }}</td>
                            <td>{{ $result->user->name }}</td>
                            <td>{{ $result->personality->first()->personality }}</td>
                            <td>{{ \Carbon\Carbon::parse($result->created_at)->format('Y-m-d') }}</td>
                            <td>
                                <a href="{{ route('student.quest.history.show', $result->id) }}"
                                    class="btn btn-light btn-active-light-primary btn-sm">Detail
                                </a>
                            </td>
                        </tr>
                    @endforeach
                </tbody>
            </table>
        </div>
    </div>
@endsection
@push('scripts')
    <script src="{{ asset('assets/student/plugins/custom/datatables/datatables.bundle.js') }}"></script>
    <script src="{{ asset('assets/employee/plugins/custom/datatables/table.js') }}"></script>
@endpush
