@php $invitation = $this->invitation; $user = $this->currentUser; @endphp {{-- Single root element for Livewire. The auth layout wrapping is applied by #[Layout('layouts.auth')] on the Show component class, NOT by an in-view component wrapper. --}}
@if ($invitation === null) {{-- Unknown token --}} @elseif ($invitation->isAccepted()) {{ __('Log in') }} @elseif ($invitation->isExpired()) @elseif ($user !== null && strcasecmp($user->email, $invitation->email) !== 0) {{-- Wrong logged-in account --}}
@csrf {{ __('Log out') }}
@elseif ($user !== null) {{-- Authenticated and matches: show accept button. --}} @error('invitation') @enderror
{{ __('Accept invitation') }}
@elseif ($this->emailHasExistingUser) {{-- Guest, but email already has a user → log in flow. --}} {{ __('Log in') }} @else {{-- Guest, brand-new user → register form. Email is locked to the invitation email server-side. --}} @error('invitation') @enderror
{{-- Email shown for context only — the actual address used at create time comes from the server-trusted invitation row. The input is disabled so it cannot even be inspected/modified casually. --}} {{ __('Create account and join') }} @endif