{block name='snippets-wishlist-dropdown'}
    {get_static_route id='wunschliste.php' assign='wishlistURL'}
    {et_isShopVersionAtLeast value="5.2.0-beta" assign='shopIsAtLeast52'}
    {if $wishlists->isNotEmpty()}
        {block name='snippets-wishlist-dropdown-wishlists'}
            <div class="wishlist-dropdown-items table-responsive max-h-sm lg-max-h">
                <table class="table table-vertical-middle">
                    <tbody>
                        {foreach $wishlists as $wishlist}
                            {if $shopIsAtLeast52}
                                {$wishlistID = $wishlist->getID()}
                                {$wishlistName = $wishlist->getName()}
                                {$wishlistIsPublic = $wishlist->isPublic()}
                                {$wishlistProductCount = $wishlist->getProductCount()}
                            {else}
                                {$wishlistID = $wishlist->kWunschliste}
                                {$wishlistName = $wishlist->cName}
                                {$wishlistIsPublic = ($wishlist->nOeffentlich == 1)}
                                {$wishlistProductCount = $wishlist->productCount}
                            {/if}
                            <tr class="clickable-row cursor-pointer" data-href="{$wishlistURL}?wl={$wishlistID}">
                                <td>
                                    {block name='snippets-wishlist-dropdown-link'}
                                        {$wishlistName}<br />
                                    {/block}
                                    {block name='snippets-wishlist-dropdown-punlic'}
                                        <span data-switch-label-state="public-{$wishlistID}" class="small {if !$wishlistIsPublic}d-none{/if}">
                                            {lang key='public'}
                                        </span>
                                    {/block}
                                    {block name='snippets-wishlist-dropdown-private'}
                                        <span data-switch-label-state="private-{$wishlistID}" class="small {if $wishlistIsPublic}d-none{/if}">
                                            {lang key='private'}
                                        </span>
                                    {/block}
                                </td>
                                {block name='snippets-wishlist-dropdown-count'}
                                    <td class="text-right-util text-nowrap-util">
                                        {$wishlistProductCount} {lang key='products'}
                                    </td>
                                {/block}
                            </tr>
                        {/foreach}
                    </tbody>
                </table>
            </div>
        {/block}
    {/if}
    {block name='snippets-wishlist-dropdown-new-wl'}
        <div class="wishlist-dropdown-footer dropdown-body">
            {block name='snippets-wishlist-dropdown-new-wl-link'}
                {include file="widgets/base/button.tpl" variant="primary" classes="btn-sm btn-block" href="{$wishlistURL}?newWL=1" title="{lang key='addNew' section='wishlist'}" label="{lang key='addNew' section='wishlist'}"}
            {/block}
        </div>
    {/block}
{/block}
