{{-- Shared application topbar. @include('partials.topbar', ['showRefresh' => true]) Options: $showRefresh — render the "fetch new mail" button. Only pass true from layouts.app, which is the layout that defines storeNewEmail(). $showAutoReply — render the "reply to the next few mails now" button. Same rule: only layouts.app wires up its click handler. $pageTitle — override the title derived from the route name. --}} @php $showRefresh = $showRefresh ?? false; $showAutoReply = $showAutoReply ?? false; // Titles are keyed by route name so every screen gets a real heading // instead of the generic "Mail Dashboard" the old navbar showed. $routeTitles = [ 'dashboard' => 'Dashboard', 'mail.info' => 'Email Inbox', 'mails.filter' => 'Email Inbox', 'mails.show' => 'Message', 'mails.show_single' => 'Message', 'mails.reply' => 'Reply', 'employee' => 'Employees', 'team_member' => 'Team Members', 'mail_with_email_id' => 'Employee Mail', 'departments.index' => 'Departments', 'departments.edit' => 'Edit Department', 'assign.department' => 'Assign Department', 'showGroup' => 'Department List', 'inbox_groups.index' => 'Inbox Groups', 'inbox_groups.create' => 'New Inbox Group', 'inbox_groups.edit' => 'Edit Inbox Group', 'inbox_groups.search' => 'Group Search', 'inboxgroup.viewHead' => 'Department Head', 'set_email' => 'Email Settings', 'add.route' => 'Add Email Account', 'domain' => 'Domains', 'settings' => 'Settings', ]; $resolvedTitle = $pageTitle ?? ($routeTitles[Route::currentRouteName()] ?? 'EmailInsightAI'); // See the note in partials/sidebar.blade.php — $employee may be a leftover // loop variable from the child view rather than a mailbox being viewed. $viewedMailbox = isset($employee) && is_object($employee) && isset($employee->email, $employee->id, $employee->account_type) ? $employee : null; @endphp

{{ $resolvedTitle }} @if ($viewedMailbox && $viewedMailbox->email !== Auth::user()?->email) {{-- Make it unmistakable when an admin is looking at someone else's mailbox. The word "mailbox" is load-bearing: a bare address here was read as "you are signed in as this person", which made an empty "Assigned to me" — a list keyed to Auth::id(), not to the mailbox — look like the assignment had been lost. --}} · mailbox of {{ $viewedMailbox->email }} @endif

{{-- The in-app half of the follow-up reminder: count, panel, and the toast/desktop notification driven from partials.shell-scripts. --}} @auth @include('partials.follow-up-bell') @endauth @if ($showAutoReply) {{-- One click runs the latest ten mails in this inbox through the auto-reply rules. The ten is decided server-side (AutoReplyController::RUN_NOW_LIMIT); it is spelled out here only so the button says what it does. --}} @endif @if ($showRefresh) @endif @yield('topbar_actions')