@extends('employee.layouts.app')
@section('title', 'Manajemen Pengguna | Career Development and Consultation (CDC)')
@section('navigation')
    <h1 class="my-1 d-flex align-items-center text-dark fw-bolder fs-3">Pengguna
        <span class="mx-2 border-gray-200 h-20px border-start ms-3"></span>
        <small class="my-1 text-muted fs-7 fw-bold ms-1">Manajemen Pengguna</small>
    </h1>
@endsection
@section('content')
    <div class="card">
        <div class="pt-4 border card-body">
            <table class="table align-middle table-row-dashed fs-6 gy-5" id="myTable">
                <thead>
                    <th class="max-w-5px">Nomor</th>
                    <th class="min-w-100px">Pengguna</th>
                    <th class="min-w-125px">Akses</th>
                    <th class="min-w-125px">Tanggal Bergabung</th>
                    <th class="min-w-100px">Pengaturan</th>
                </thead>
                <tbody class="text-gray-600 fw-bold">
                    @foreach ($users as $index => $user)
                        <tr>
                            <td>{{ $index + 1 }}</td>
                            <td class="d-flex align-items-center">
                                <div class="overflow-hidden symbol symbol-circle symbol-50px me-3">
                                    <div class="symbol-label">
                                        <img src="{{ asset('assets/employee/media/avatars/blank.png') }}"
                                            alt="{{ $user->name }}" class="w-100" />
                                    </div>
                                </div>
                                <div class="d-flex flex-column">
                                    <span class="mb-1 text-gray-800">{{ $user->name }}</span>
                                    <span>{{ $user->email }}</span>
                                </div>
                            </td>
                            <td>{{ ucfirst($user->role === 'admin' ? 'Admin' : ($user->role === 'student' ? 'Mahasiswa' : $user->role)) }}
                            </td>
                            <td>{{ $user->created_at }}</td>
                            <td>
                                <div class="d-flex">
                                    <a href="{{ route('employee.users.edit', $user->id) }}"
                                        class="btn btn-light btn-active-light-primary btn-sm">Perbarui
                                    </a>
                                    {{-- <form action="{{ route('weights.delete', $weight->id) }}" method="POST">
                                        @csrf
                                        @method('delete')
                                        <a onclick="event.preventDefault(); this.closest('form').submit();"
                                            class="btn btn-light btn-active-light-primary btn-sm">Hapus</a>
                                    </form> --}}
                                </div>
                            </td>
                        </tr>
                    @endforeach
                </tbody>
            </table>
        </div>
    </div>
@endsection
