@php /** * Header AI assistant off-canvas (slides in right → left, Bootstrap offcanvas-end). * Rendered once in the dashboard layout for vendor / manager / super-admin. Reuses * the shared chat widget — and the same treatment as the assistant PAGE (the * zero-state hero, prompt cards, hairline composer; see app.css). The chat * endpoint + starter prompts are role-scoped — vendor/manager talk to their * restaurant assistant, super-admin to the platform-wide assistant. */ use App\Support\Auth; $aiRole = (string) Auth::role(); $aiAdmin = $aiRole === 'super_admin'; $aiSvc = new \App\Services\Ai(); $aiSite = setting('site_name', 'QuickMunch'); @endphp @php // data-bs-scroll: skip Bootstrap's body scroll-lock. The dashboard sidebar is // position:sticky against the body scroll container, so the default lock // (overflow:hidden + scrollbar-gutter padding) shifts and breaks it. The backdrop // still dims + closes on outside click. @endphp

@partial('icon-ai-sparkle', ['gid' => 'title', 'class' => 'qm-ai-spark me-2']){{ t_raw('nav.ai_assistant') }}

@partial('ai-chat-widget', [ 'wrapClass' => 'qm-chat', 'ready' => $aiSvc->isReady(), 'reason' => $aiSvc->disabledReason(), 'disabledNote' => $aiAdmin ? t_raw('admin.ai.disabled_extra_note') : t_raw('vendor.ai.disabled_extra_note'), 'endpoint' => $aiAdmin ? '/admin/ai/chat' : '/vendor/ai-assistant/chat', 'userAvatar' => avatar_src(Auth::user()['avatar'] ?? null), 'welcome' => $aiAdmin ? t_raw('admin.ai.welcome_message', [':site' => $aiSite]) : t_raw('vendor.ai.welcome_message', [':site' => $aiSite]), /* The drawer is the quick lane: no starter questions — the full prompt gallery lives on the assistant PAGE. */ 'suggestions' => [], ])