@extends('admin.layouts.app')

@section('title', __('dashboard.academy_schedule_details'))

@section('content')
<x-admin.page-header title="{{ __('dashboard.academy_schedule_details') }}" :breadcrumbs="[__('dashboard.academy_schedules') => route('admin.academy-schedules.index'), __('dashboard.details') => '']" />
<div class="row justify-content-center">
    <div class="col-xl-12">
        <div class="card">
            <div class="card-header">
                <h5 class="card-title mb-0">{{ __('dashboard.general_info') }}</h5>
            </div>
            <div class="card-body">
                <div class="row">
                    <x-view-col label="{{ __('dashboard.id') }}" :value="$academySchedule->id"/>
                    <x-view-col label="{{ __('dashboard.academy') }}" :value="$academySchedule->academy?->name ?? '-'"/>
                    <x-view-col label="{{ __('dashboard.court') }}" :value="$academySchedule->court?->name ?? '-'"/>
                    @php
    $daysLabels = collect($academySchedule->days ?? [])->map(fn($d) => \App\Enums\DayOfWeekEnum::label((int)$d))->implode(', ') ?: '-';
@endphp
<x-view-col label="{{ __('dashboard.days') }}" :value="$daysLabels"/>
                    <x-view-col label="{{ __('dashboard.start_time') }}" :value="\Carbon\Carbon::parse($academySchedule->start_time)->format('H:i')"/>
                    <x-view-col label="{{ __('dashboard.end_time') }}" :value="\Carbon\Carbon::parse($academySchedule->end_time)->format('H:i')"/>
                    <x-view-col label="{{ __('dashboard.start_date') }}" :value="$academySchedule->start_date?->format('Y-m-d')"/>
                    <x-view-col label="{{ __('dashboard.end_date') }}" :value="$academySchedule->end_date?->format('Y-m-d')"/>
                    <x-view-col label="{{ __('dashboard.status') }}" :value="$academySchedule->is_active ? __('dashboard.active') : __('dashboard.inactive')"/>
                    <x-view-col label="{{ __('dashboard.created_at') }}" :value="$academySchedule->created_at"/>
                    <x-view-col label="{{ __('dashboard.updated_at') }}" :value="$academySchedule->updated_at"/>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection
