<li class="nav-item user">
    <a class="dropdown-toggle gray-6 d-flex text-decoration-none align-items-center lh-sm p-0" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false" title="User" data-bs-auto-close="outside">
        <img class="avatar rounded-1 border border-3" src="{if isset($session_avatar)} {$session_avatar} {else} {$avatar} {/if}" alt="avatar">
        <span class="ms-2 fs-6 d-none d-sm-inline-flex">{if isset($session_name)} {$session_name} {else} {$name} {/if}</span>
    </a>
    <div class="dropdown-menu dropdown-menu-end shadow p-2 p-xl-3 rounded-2 authenticated">
        <div class="bg-body p-3 rounded-3">
            <h4 class="mb-1 title-font">{if isset($session_name)} {$session_name} {else} {$name} {/if}</h4>
            <p class="small text-muted mb-2"><b>{$lang.header.email}:</b> {if isset($session_user_email)} {$session_user_email} {else} {$user_email} {/if}</p>
            <p class="small text-muted mb-0"><b>{$lang.header.group}:</b>{if isset($session_group)} {$session_group} {else} {$group_name} {/if}</p><hr>
            <p class="small text-muted mb-0"><b>Subscription:</b>{if isset($userSubscription)} {$userSubscription} {else}  {/if}</p>
        </div>
        <ul class="list-unstyled mt-2">
            <li>
                <a class="dropdown-item rounded-1" aria-label="my wallet" href="?action=my-wallet">
                    <span class="align-middle">{$lang.header.balance}: <span class="fw-bold text-success"><span data-purecounter-start="0" data-purecounter-separator="," data-purecounter-currency="$" data-purecounter-end="{if isset($session_balance)} {$session_balance} {else} {$balance} {/if}" class="purecounter">{$user.balance}</span></span></span>
                </a>
            </li>
            <a class="dropdown-item rounded-1" href="{$currentDir}?action=profile">{$lang.header.psettings}</a>
            <li class="dropdown-divider"></li>
        </ul>
        <a class="btn py-2 btn-primary w-100 mt-2 rounded-1" href="#" onclick="logout(event)">
            <img src="{$stheme}/svg/logout.svg" alt="">
            <span style="top: 1.5px; left:3px; position: relative;">{$lang.header.logout}</span>
        </a>
        <script>
            function logout(event) {
                var xhr = new XMLHttpRequest();
                xhr.open('GET', 'engine/logout.php', true);
                xhr.onload = function () {
                    location.reload();
                };
                xhr.send();
                event.preventDefault();
            }
        </script>
        <div class="mt-2 btn-group w-100">
            <a href="/admin?action=policy-terms-cookies&tab=policy" class="btn btn-outline-secondary btn-sm">{$lang.header.policy}</a>
            <a href="/admin?action=policy-terms-cookies&tab=terms" class="btn btn-outline-secondary btn-sm">{$lang.header.terms}</a>
            <a href="/admin?action=policy-terms-cookies&tab=cookies" class="btn btn-outline-secondary btn-sm">{$lang.header.cookies}</a>
        </div>
    </div>
</li>