@php $mode = $this->currentMode(); $events = $this->eventsByDay(); $anchor = $this->anchor(); $today = today()->toDateString(); $chip = fn ($event) => 'bg-'.$event->type->getColor().'-50 text-'.$event->type->getColor().'-700 ring-'.$event->type->getColor().'-200 dark:bg-white/5 dark:text-'.$event->type->getColor().'-300'; @endphp {{-- Toolbar: navigation, title, view switch --}}
{{ __('calendar.previous') }} {{ __('calendar.today') }} {{ __('calendar.next') }}

{{ $this->heading() }}

@foreach (\App\Filament\Pages\ContractCalendar::VIEWS as $view) {{ __('calendar.views.'.$view) }} @endforeach
{{-- Event type filters (legend) --}}
@foreach (\App\Domain\Dashboard\Enums\CalendarEventType::cases() as $type) @php($on = in_array($type->value, $this->types, true)) @endforeach
@if ($mode === 'month')
@foreach ($this->weekdays() as $weekday)
{{ $weekday }}
@endforeach
@foreach ($this->days() as $day) @php($key = $day->toDateString()) @php($dayEvents = $events[$key] ?? [])
$day->month !== $anchor->month])>
$key === $today, 'text-gray-400' => $day->month !== $anchor->month && $key !== $today, 'text-gray-700 dark:text-gray-200' => $day->month === $anchor->month && $key !== $today])>{{ $day->day }}
@foreach (array_slice($dayEvents, 0, $this->maxChips()) as $event) {{ $event->reference }} @endforeach @if (count($dayEvents) > $this->maxChips()) @endif
@endforeach
@elseif ($mode === 'week')
@foreach ($this->days() as $index => $day) @php($key = $day->toDateString())
$key === $today])>
{{ $this->weekdays()[$index] }}
{{ $day->day }}
@endforeach
@else
@forelse ($events as $key => $dayEvents)
$key === $today, 'text-gray-900 dark:text-white' => $key !== $today])> {{ \Carbon\CarbonImmutable::parse($key)->locale(app()->getLocale())->translatedFormat('l j F') }}
@empty
{{ __('calendar.empty') }}
@endforelse
@endif