
<?php
    $mode = $mode ?? 'desktop';
?>
<div class="dropdown <?php echo e($mode === 'mobile-header' ? 'ms-3' : ''); ?>" <?php if($mode === 'mobile-header'): ?> id="headerAccountDropdownMobile" <?php endif; ?>>
    <?php if(auth()->guard()->check()): ?>
        <?php if($mode === 'desktop'): ?>
            <a href="#" data-bs-toggle="dropdown" aria-expanded="false" role="button"
               class="btn btn-white header-register border-0 rounded-pill">
                <figure class="avatar avatar-sm me-1">
                    <img src="<?php echo e(asset('theme/assets/image/user.png')); ?>" alt="">
                </figure>
                <span><?php echo e(auth()->user()->first_name); ?></span>
            </a>
        <?php else: ?>
            <a href="#" data-bs-toggle="dropdown" aria-expanded="false" role="button"
               class="btn btn-white header-register border-0 rounded-pill p-1"
               id="headerAccountToggleMobile"
               aria-label="حساب کاربری">
                <figure class="avatar">
                    <img src="<?php echo e(asset('theme/assets/image/user.png')); ?>" alt="">
                </figure>
            </a>
        <?php endif; ?>

        <ul class="dropdown-menu dropdown-menu-end" id="headerAccountMenuMobile">
            <?php if($mode !== 'desktop'): ?>
                <li class="px-3 py-2 border-bottom">
                    <span class="fw-bold font-14"><?php echo e(auth()->user()->first_name); ?> <?php echo e(auth()->user()->last_name); ?></span>
                </li>
            <?php endif; ?>
            <li><a href="<?php echo e(route('panel.index')); ?>" class="dropdown-item"><i class="bi bi-house-door me-2"></i>پروفایل</a></li>
            <li><a href="<?php echo e(route('panel.orders.index')); ?>" class="dropdown-item"><i class="bi bi-cart-check me-2"></i>سفارش های من</a></li>
            <li><a href="<?php echo e(route('panel.addresses.index')); ?>" class="dropdown-item"><i class="bi bi-pin-map me-2"></i>آدرس های من</a></li>
            <li><a href="<?php echo e(route('panel.announcements.index')); ?>" class="dropdown-item"><i class="bi bi-bell me-2"></i>پیام ها و اطلاعیه ها</a></li>
            <li><a href="<?php echo e(route('panel.comments.index')); ?>" class="dropdown-item"><i class="bi bi-chat-dots me-2"></i>نظرات من</a></li>
            <li><a href="<?php echo e(route('panel.tickets.index')); ?>" class="dropdown-item"><i class="bi bi-question-circle me-2"></i>درخواست پشتیبانی</a></li>
            <li><a href="<?php echo e(route('panel.wishes.index')); ?>" class="dropdown-item"><i class="bi bi-heart me-2"></i>محصولات مورد علاقه</a></li>
            <li>
                <a href="<?php echo e(route('logout')); ?>" class="dropdown-item mct-hover"
                   onclick="event.preventDefault(); document.getElementById('header-logout-form').submit();">
                    <i class="bi bi-arrow-right-square me-2"></i>خروج از حساب کاربری
                </a>
            </li>
        </ul>
    <?php else: ?>
        <?php if($mode === 'desktop'): ?>
            <a href="#" data-bs-toggle="dropdown" aria-expanded="false" role="button"
               class="btn btn-white header-register border-0 rounded-pill">
                <i class="bi bi-person-circle font-20 text-muted me-1"></i>
                <span>حساب کاربری</span>
            </a>
        <?php else: ?>
            <a href="#" data-bs-toggle="dropdown" aria-expanded="false" role="button"
               class="btn btn-white header-register border-0 rounded-pill p-1"
               id="headerAccountToggleMobile"
               aria-label="حساب کاربری">
                <figure class="avatar">
                    <img src="<?php echo e(asset('theme/assets/image/user.png')); ?>" alt="">
                </figure>
            </a>
        <?php endif; ?>

        <ul class="dropdown-menu dropdown-menu-end" id="headerAccountMenuMobile">
            <li><a href="<?php echo e(route('login')); ?>" class="dropdown-item"><i class="bi bi-box-arrow-in-right me-2"></i>ورود</a></li>
            <li><a href="<?php echo e(route('register')); ?>" class="dropdown-item"><i class="bi bi-person-plus me-2"></i>ثبت نام</a></li>
        </ul>
    <?php endif; ?>
</div>
<?php /**PATH C:\xampp\htdocs2\engine\resources\views/site/partials/_header-account.blade.php ENDPATH**/ ?>