@php $days = [ 'mon' => 'Mon', 'tue' => 'Tue', 'wed' => 'Wed', 'thu' => 'Thu', 'fri' => 'Fri', 'sat' => 'Sat', 'sun' => 'Sun', ]; $windows = $settings['availability_windows'] ?? $defaultWindows; @endphp
{{-- Left rail --}} {{-- Main --}}
@if ($isConnected)

{{ __('Booking') }} {{ __('settings') }}

{{ __('Calendar:') }} {{ $oauth['calendar_name'] ?? ($oauth['calendar_id'] ?? '— pick below —') }} · Connected {{ \Illuminate\Support\Carbon::parse($oauth['connected_at'] ?? null)?->diffForHumans() ?? '—' }}

@else

{{ __('Connect') }} {{ __('Google Calendar') }}

{{ __("Let customers book appointments inside WhatsApp. :app reads your calendar's free/busy intervals and writes confirmed bookings back as calendar events.", ['app' => \App\Models\SystemSetting::get('app_name', config('app.name', 'WaDesk'))]) }}

@endif
@if (session('success'))
{{ session('success') }}
@endif @if (session('error'))
{{ session('error') }}
@endif @if (!$isConnected) @if (!$appEnabled)
{{ __("Google Calendar isn't configured yet") }}

An admin needs to register a Google Cloud OAuth client at {{ __('console.cloud.google.com') }} and paste the Client ID + Client Secret at /admin/settings/google-calendar.

@else

{{ __('Connect your Google Calendar') }}

You'll be redirected to Google to approve calendar access. We request: https://www.googleapis.com/auth/calendar

@csrf
@endif @else {{-- Connected: full settings form --}}
@csrf {{-- Calendar picker --}}
{{ __('Step 1') }}

{{ __('Which calendar to book into') }}

@csrf
@if (empty($calendars))

{{ __('No writable calendars returned.') }}

@else

{{ __("Tip: pick a dedicated calendar so personal events don't mix with bookings.") }}

@endif
{{-- Availability windows --}}
{{ __('Step 2') }}

{{ __('When can customers book') }}

{{ __('One row per weekday. Leave blank to disable that day entirely.') }}

@foreach ($days as $key => $label) @php $win = $windows[$key][0] ?? ['from' => '', 'to' => '']; @endphp
{{ $label }}
@endforeach
{{-- Rules --}}
{{ __('Step 3') }}

{{ __('Booking rules') }}

{{ __('Cancel') }}
@endif