@php $tz = config('app.display_timezone'); $cards = [ ['label' => __('Status'), 'value' => $enabled ? __('On') : ($configured ? __('Off') : __('Not set up')), 'icon' => 'link', 'accent' => $enabled ? '#059669' : '#64748b', 'sub' => $enabled ? __('Meetings go to Google') : __('BillPro calendar only')], ['label' => __('Officers linked'), 'value' => $linkedCount, 'icon' => 'users', 'accent' => '#4f46e5', 'sub' => $domain !== '' ? '@'.$domain : __('No domain set')], ['label' => __('Needs attention'), 'value' => $attentionCount, 'icon' => 'exclamation-triangle', 'accent' => $attentionCount > 0 ? '#e11d48' : '#64748b', 'sub' => $attentionCount > 0 ? __('See the table') : __('Nothing failing')], ['label' => __('Upcoming in Google'), 'value' => $inGoogle, 'icon' => 'video-camera', 'accent' => '#0891b2', 'sub' => $lastSync ? __('Synced :when', ['when' => $lastSync->diffForHumans()]) : __('Not synced yet')], ]; $stateMeta = [ 'linked' => ['label' => __('Linked'), 'color' => 'emerald'], 'error' => ['label' => __('Needs attention'), 'color' => 'rose'], 'off' => ['label' => __('Google is off'), 'color' => 'slate'], 'no_email' => ['label' => __('No Workspace email'), 'color' => 'amber'], ]; @endphp
@if ($canManage && $enabled) {{ __('Test connection') }} {{ __('Testing…') }} {{ __('Sync now') }} {{ __('Syncing…') }} @endif
@foreach ($cards as $m)

{{ $m['label'] }}

{{ $m['value'] }}

{{ $m['sub'] }}
@endforeach
{{-- The company switch --}}

{{ __('Calendar and Meet') }}

@if (! $configured)

{{ __('The server is not set up for Google yet.') }}

{{ $problem }}

{{ __('Until it is, meetings are kept in BillPro only, which works as before.') }}

@endif

@if ($enabled) {{ __('On since :date. Each new meeting is checked against the organiser\'s free and busy times, then booked in their Google Calendar with a Meet link and an invitation to the client contact. A reschedule or cancellation in Google updates BillPro within a few minutes.', ['date' => $setting?->connected_at?->copy()->timezone($tz)->format('j M Y')]) }} @else {{ __('Off. Meetings are kept in BillPro only. Turning it on affects meetings booked or changed from then on; earlier meetings are not sent to Google.') }} @endif

@if ($canManage)
@if ($enabled) {{ __('Turn off') }} @elseif ($configured) {{ __('Turn on') }} @endif
@endif
{{-- Gemini notes --}}

{{ __('Gemini meeting notes') }}

{{ $notesOn ? __('On') : __('Off') }}

{{ __('When the organiser uses "Take notes for me" in Meet, BillPro collects the notes after the meeting, files them on the meeting note as a draft, and the AI assistant proposes the needs, decisions, competitors and actions. Nothing counts until the officer reviews and confirms the note.') }}

{{ __('Needs a Google Workspace plan that includes Gemini notes in Meet (Business Starter does not), English only, Meet on a computer. In-person meetings are written up by hand as before.') }}

@if ($canManage && $enabled) {{ $notesOn ? __('Turn notes intake off') : __('Turn notes intake on') }} @elseif ($canManage)

{{ __('Turn Google Workspace on first.') }}

@endif
@if ($canManage) {{-- What the Workspace admin needs --}}

{{ __('Setup for the Workspace admin') }}

{{ __('1. In Google Cloud, enable these APIs') }}

  • {{ __('Google Calendar API') }}
  • {{ __('Google Meet REST API (for Gemini notes)') }}
  • {{ __('Google Drive API (for Gemini notes)') }}

{{ __('2. In the Admin console, Security, API controls, Domain-wide delegation, add') }}

{{ __('Client ID') }}: {{ $clientId ?? __('Not available until the key is installed') }}

{{ __('3. With these scopes, comma separated') }}

{{ implode(',', $calendarScopes) }}

{{ __('Add these too only if Gemini notes will be used:') }}

{{ implode(',', $notesScopes) }}

@endif {{-- Officers --}}

{{ $canManage ? __('Officers') : __('Your calendar') }}

{{ __('BillPro acts as each person\'s Workspace email. It starts as their sign-in email when that is on :domain; a director can change it, or clear it to keep that person on the BillPro calendar only.', ['domain' => $domain ?: __('the company domain')]) }}

@forelse ($rows as $row) @empty @endforelse
{{ __('Person') }} {{ __('Workspace email') }} {{ __('Status') }} {{ __('Last synced') }} {{ __('Last problem') }}

{{ $row['user']->name }}

{{ __('Signs in as :email', ['email' => $row['user']->email]) }}

@if ($canManage)
{{ __('Save') }} @else {{ $row['email'] ?? __('None, Google is off for you') }} @endif
{{ $stateMeta[$row['state']]['label'] }} {{ $row['last_synced_at'] ? $row['last_synced_at']->copy()->timezone($tz)->format('j M Y H:i') : __('Not yet') }} {{ $row['last_error'] ?? __('None') }}