{% trans_default_domain 'users' %}
<div {{ attributes }}>
   <twig:block name="content">
      <div class="b2b-panel">
         <div class="container">
            <div class="b2b-panel-inner">
               <div class="b2b-panel-icon">
                  <twig:ux:icon name="user" class="c-icon arrow-icon"/>
                  <p>
                     {% if this.show_b2b_client_text %}
                     {{ 'info.b2b.client'|trans }}
                     {% endif %}
                     {% if this.show_user_group %}
                     <span class="b2b-user-group">{{ this.userGroupName }}</span>
                     {% endif %}
                     <strong>
                        {% if this.userInfo['firm']['firm'] ?? '' %}
                           {{ this.userInfo['firm']['firm'] ?? '' }}
                         {% elseif this.userInfo['contact']['name'] ?? '' and this.userInfo['contact']['surname'] ?? '' %}
                           {{ this.userInfo['contact']['name'] ?? '' }}&nbsp;{{ this.userInfo['contact']['surname'] ?? '' }}
                         {% else %}
                           {{ this.userInfo['contact']['email'] ?? '' }}
                         {% endif %}
                     </strong>
                  </p>
               </div>
                  <div class="b2b-panel-icon">
                     <twig:ux:icon name="stats" class="c-icon arrow-icon"/>
                     <p>
                        {{ 'info.obrat'|trans }} {{ 'now'|date('Y') }}
                        <strong>{{ this.spending({year: 'now'|date('Y')})|formatPrice }}</strong>
                     </p>
                  </div>
               {% if this.show_fast_access %}
                  <div class="b2b-panel-menu">
                     <twig:ux:icon name="rocket" class="c-icon arrow-icon"/>
                     <div>
                        <p>{{ 'info.fast.access'|trans }}</p>
                        <ul class="list-inline">
                           <li><a href="{{ path('settings') }}">{{ 'info.account'|trans }}</a></li>
                           <li><a href="{{ path('orders') }}">{{ 'info.orders'|trans }}</a></li>
                           {% if module.WATCHDOG %}
                              <li><a href="{{ path('kupshop_watchdog_watchdog_watchdog') }}">{{ 'info.watchdog'|trans }}</a></li>
                           {% endif %}
                           <li><a href="{{ path('kupshop_content_cart_cart_1') }}">{{ 'info.order.import'|trans }}</a></li>
                           <li class="repeat-order"><twig:ux:icon name="repeat" class="c-icon"/><a href="{{ path('orders') }}">{{ 'info.order.repeat'|trans }}</a></li>
                        </ul>
                     </div>
                  </div>
               {% endif %}

               {% if this.url_pricelists or this.url_offers %}
                  <div class="b2b-panel-offer">
                     <twig:ux:icon name="case" class="c-icon arrow-icon"/>
                     <p>{{ 'info.dealers'|trans }}</p>
                     <ul class="list-inline">
                        {% if this.url_pricelists %}
                           <li><a href="{{ this.url_pricelists }}">{{ 'info.pricelists'|trans }}</a></li>
                        {% endif %}

                        {% if this.url_offers %}
                           <li><a href="{{ this.url_offers }}">{{ 'info.current.offers'|trans }}</a></li>
                        {% endif %}
                     </ul>
                  </div>
               {% endif %}
               {% if this.show_bonus_points_credit and this.bonusPointsValue %}
                  <div class="b2b-panel-icon">
                     <twig:ux:icon name="percentage" class="c-icon arrow-icon"/>
                     <p>
                        {{ 'actual_credit'|trans }}
                        <strong>{{ this.bonusPointsValue|formatPrice }}</strong>
                     </p>
                  </div>
               {% endif %}
               {% if this.show_salesman and this.salesman %}
                  <div class="b2b-panel-icon">
                     <twig:ux:icon name="handshake" class="c-icon arrow-icon"/>
                     <p>
                        {{ 'salesman'|trans }}
                        <strong>{{ this.salesman.name }}</strong>
                     </p>
                  </div>
               {% endif %}
               <twig:block name="custom_field"></twig:block>
            </div>
         </div>
      </div>
   </twig:block>
</div>
