{% from 'wallet/components/wallet_menu_item.jinja' import wallet_menu_item %}

{# 
    wallet_menu - Tabs menu to navigate between the wallet screens.
    Parameters:
    - active_menuitem: Current active tab. Options: 'transactions', 'addresses', 'receive', 'send', 'settings'.
	- wallet_alias: The wallet alias (used in the URL navigation).
	- ext_wallettabs: Dictionary gathered by execute_ext_callbacks() in the service manager. Looks like this:
		{'rubberduck': [{'title': 'Secret rubberduck wallet', 'endpoint': 'secret_rubberduck_wallet'}]}
 #}
{% macro wallet_menu(active_menuitem, wallet_alias, ext_wallettabs) -%}
	<nav class="text-center text-dark-200 border-b border-dark-600">
		<ul class="flex flex-wrap -mb-px">
			{{ wallet_menu_item('history', _('Transactions'), wallet_alias, active_menuitem, isLeft=true, id='btn_transactions') }}
			{{ wallet_menu_item('addresses', _('Addresses'), wallet_alias, active_menuitem) }}
			{{ wallet_menu_item('receive', _('Receive'), wallet_alias, active_menuitem, id='btn_receive') }}
			{{ wallet_menu_item('send', _('Send'), wallet_alias, active_menuitem, id='btn_send') }}
			{% if not ext_wallettabs %}
				{% set ext_wallettabs = {} %}
			{% endif %}
			{% for ext_id, wallettabs in ext_wallettabs.items() %}
				{% for wallettab in wallettabs %}
					{{ wallet_menu_item(wallettab["endpoint"], _(wallettab["title"]), wallet_alias, active_menuitem, isRight=false, blueprint=ext_id+"_endpoint") }}
				{% endfor %}
			{% endfor %}
			{{ wallet_menu_item('settings', _('Settings'), wallet_alias, active_menuitem, isRight=true, id='btn_settings') }}
			<!-- <a href="javascript:void(0);" class="mobile-nav-icon" onclick="toggleMobileNav(this, `{{ url_for('static', filename='img/caret-down.svg') }}`, `{{ url_for('static', filename='img/caret-up.svg') }}`)"> -->
			<!-- 	<img data-style="width: 36px;" src="{{ url_for('static', filename='img/caret-down.svg') }}" class="svg-white"/> -->
			<!-- </a> -->
		</ul>
	</nav>
{%- endmacro %}
