<div class="edit-category {{if expandedMenu "expanded-menu"}}">
  <div class="edit-category-title">
    <h2>{{title}}</h2>
    {{#unless mobileView}}
      {{#if model.id}}
        {{d-button
          class="category-back"
          action=(action "goBack")
          label="category.back"
          icon="caret-left"
        }}
      {{/if}}
    {{/unless}}
  </div>

  <div class="edit-category-nav">
    <ul class="nav nav-stacked">
      {{edit-category-tab panels=panels selectedTab=selectedTab params=parentParams tab="general"}}
      {{edit-category-tab panels=panels selectedTab=selectedTab params=parentParams tab="security"}}
      {{edit-category-tab panels=panels selectedTab=selectedTab params=parentParams tab="settings"}}
      {{edit-category-tab panels=panels selectedTab=selectedTab params=parentParams tab="images"}}
      {{edit-category-tab panels=panels selectedTab=selectedTab params=parentParams tab="topic-template"}}
      {{#if siteSettings.tagging_enabled}}
        {{edit-category-tab panels=panels selectedTab=selectedTab params=parentParams tab="tags"}}
      {{/if}}
    </ul>
  </div>

  <div class="edit-category-content">
    <h3>{{selectedTabTitle}}</h3>

    {{#each panels as |tab|}}
      {{component tab selectedTab=selectedTab category=model registerValidator=(action "registerValidator")}}
    {{/each}}
  </div>

  {{#if showDeleteReason}}
    <div class="edit-category-delete-warning">
      <p class="warning">{{html-safe model.cannot_delete_reason}}</p>
    </div>
  {{/if}}

  <div class="edit-category-footer">
    {{d-button id="save-category" class="btn-primary" disabled=disabled action=(action "saveCategory") label=saveLabel}}

    {{#if model.can_delete}}
      {{d-button
        class="btn-danger"
        disabled=deleteDisabled
        action=(action "deleteCategory")
        icon="far-trash-alt"
        label="category.delete"
      }}
    {{else if model.id}}
      <div class="disable-info">
        {{d-button
          disabled=deleteDisabled
          class="btn-default"
          action=(action "toggleDeleteTooltip")
          icon="question-circle"
          label="category.delete"
        }}
      </div>
    {{/if}}
  </div>
</div>
