<?php
    $pageTitle = trim($__env->yieldContent('page_title') ?: $__env->yieldContent('title') ?: 'CRM');
?>
<header class="portal-topbar">
    <div class="portal-topbar-left">
        <button type="button" class="portal-topbar-menu-btn d-lg-none" id="portalSidebarOpen" aria-label="Open menu">
            <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 12h18M3 6h18M3 18h18"/></svg>
        </button>
        <div class="portal-topbar-titles">
            <?php if (! empty(trim($__env->yieldContent('breadcrumbs')))): ?>
                <nav class="portal-breadcrumb" aria-label="Breadcrumb">
                    <?php echo $__env->yieldContent('breadcrumbs'); ?>
                </nav>
            <?php else: ?>
                <nav class="portal-breadcrumb" aria-label="Breadcrumb">
                    <a href="<?php echo e(default_home_url()); ?>">Home</a>
                    <?php if(!request()->routeIs('leads.dashboard', 'home', 'crm.home')): ?>
                        <span class="portal-breadcrumb-sep">/</span>
                        <span class="portal-breadcrumb-current"><?php echo e($pageTitle); ?></span>
                    <?php endif; ?>
                </nav>
            <?php endif; ?>
            <h1 class="portal-topbar-title"><?php echo e($pageTitle); ?></h1>
        </div>
    </div>
    <div class="portal-topbar-right">
        <div class="dropdown">
            <button class="portal-topbar-user dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
                <span class="portal-topbar-avatar"><?php echo e(strtoupper(substr(auth()->user()->name, 0, 1))); ?></span>
                <span class="portal-topbar-user-text d-none d-sm-inline">
                    <span class="portal-topbar-user-name"><?php echo e(auth()->user()->name); ?></span>
                    <span class="portal-topbar-user-email"><?php echo e(auth()->user()->email); ?></span>
                </span>
            </button>
            <ul class="dropdown-menu dropdown-menu-end portal-user-dropdown">
                <li class="dropdown-header">
                    <div class="fw-semibold"><?php echo e(auth()->user()->name); ?></div>
                    <div class="small text-muted"><?php echo e(auth()->user()->email); ?></div>
                    <?php if(optional(auth()->user()->department)->name): ?>
                        <div class="small text-muted mt-1"><?php echo e(auth()->user()->department->name); ?></div>
                    <?php endif; ?>
                </li>
                <li><hr class="dropdown-divider"></li>
                <li>
                    <form method="POST" action="<?php echo e(route('logout')); ?>" class="px-2">
                        <?php echo csrf_field(); ?>
                        <button type="submit" class="dropdown-item text-danger rounded">Logout</button>
                    </form>
                </li>
            </ul>
        </div>
    </div>
</header>
<?php /**PATH D:\laragon\www\lt\resources\views/layouts/partials/topbar.blade.php ENDPATH**/ ?>