extends ../layouts/main
block content

  .uk-margin
    div(uk-grid).uk-flex-middle
      .uk-width-expand
        h2 Category Manager
      .uk-width-auto
        a(href="/admin/category/create").uk-button.uk-button-primary
          span
            i.fas.fa-plus
          span.uk-margin-small-left Add category
  
  .uk-margin
    if Array.isArray(categories) && (categories.length > 0)
      uk.uk-list
        each category in categories
          li
            a(href=`/admin/category/${category._id}`)= category.name
    else
      h4 There are no categories.