{# Customer profile dropdown in the storefront navbar. Proper Penguin UI dropdown: behaviour is the vendored dropdowns/dropdown-with-icons.html verbatim (isOpen / openedWithKeyboard, x-trap + $focus keyboard nav, x-cloak x-show, @click.outside). Trigger is the round initials avatar (avatar-with-initials.html, primary variant). Menu items are our account links. Needs the Alpine Focus plugin (loaded before Alpine core in base.html) for x-trap / $focus. Self-contained Alpine state; the host only needs to place it in the navbar flex row. The panel has NO id on purpose — an id would make htmx hx-boost "settle" it across boosted navigations and reappear; id-less Penguin dropdowns are unaffected. #} {# initials from the full name, e.g. "Filip Priec" -> "FP" #} {% set _name = customer_name | default(value='') | trim %} {% set _parts = _name | split(pat=' ') %} {% set _initials = _parts.0 | truncate(length=1, end='') | upper %} {% if _parts | length > 1 %}{% set _second = _parts | last | truncate(length=1, end='') | upper %}{% set _initials = _initials ~ _second %}{% endif %} {% if customer_account_type == "company" %}{% set _type_label = t(key="account-company", lang=lang | default(value='sk')) %}{% else %}{% set _type_label = t(key="account-personal", lang=lang | default(value='sk')) %}{% endif %} {% set _person_icon = '' %}
{{ _type_label }}