<template>
  <nav
    class="breadcrumb"
    :class="navClass"
    aria-label="breadcrumbs"
  >
    <ul>
      <li
        v-for="item in items"
        :key="item.name"
      >
        <a
          v-if="item.href"
          :href="item.href"
        ><subitem :item="item" /></a>
        <subitem
          v-else
          :item="{ name: item.name }"
        />
      </li>
    </ul>
  </nav>
</template>
<script>
import Item from './BreadcrumbItem.vue';

export default {
  components: {
    subitem: Item,
  },
  props: {
    size: String,
    items: Array,
  },
  computed: {
    navClass() {
      const s = this.size || 'medium';
      return {
        [`is-${s}`]: true,
      };
    },
  },
};
</script>
