{% comment %}
  Renders a hamburger menu

  Accepts:
  - menu: {Object} Menu object (required)
  _ event_type: {String} open type hover/click megamenu (optional)
  - hamburger_type: {String} Open navigation modal type (optional)
  - top: {String} Top position of navigation modal, equal height of header (optional)
  _ hamburger_drawer_color_scheme: {Object} color scheme for drawer hamburger menu (required)
  _ submenu_color_scheme: {Object} color scheme for sub menu (required)

  Usage:
  {% render 'menu-hamburger',
    menu: menu,
    event_type: event_type,
    hamburger_type: hamburger_type,
    top: top,
    hamburger_drawer_color_scheme: hamburger_drawer_color_scheme,
    submenu_color_scheme: submenu_color_scheme
  %}
{% endcomment %}

{% liquid
  assign event_type = event_type | default: 'hover'
  assign hamburger_type = hamburger_type | default: 'drawer'
  assign top = top | default: '0'
%}

{% if menu != blank %}
  <xo-modal-trigger class='xo-menu-hamburger__trigger' xo-name='xo-menu-hamburger'>
    <div class='xo-menu-hamburger__icon'></div>
  </xo-modal-trigger>

  {% case hamburger_type %}
    {% when 'horizontal' %}
      {% render 'menu-hamburger-horizontal', menu: menu %}
    {% when 'vertical' %}
      {% render 'menu-hamburger-vertical', menu: menu %}
    {% else %}
      {% render 'menu-hamburger-drawer-desktop',
        menu: menu,
        event_type: event_type,
        hamburger_drawer_color_scheme: hamburger_drawer_color_scheme,
        submenu_color_scheme: submenu_color_scheme
      %}
      {% render 'menu-hamburger-drawer-mobile', menu: menu, top: top, hamburger_drawer_color_scheme: hamburger_drawer_color_scheme, submenu_color_scheme: submenu_color_scheme %}
  {% endcase %}
{% endif %}
