<script>
  export let segment;
  export let humanName;
  export let href;
  export let matchingSegment;
</script>

<div
  class="navItem"
  aria-current={segment === matchingSegment ? "page" : undefined}
>
  <div class="width-placeholder">{humanName}</div>
  <a rel="prefetch" {href}>{humanName}</a>
</div>

<style>
  .navItem {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-left: 0.5em;
    padding-right: 0.5em;
  }

  .width-placeholder{
    height: 0;
    font-weight: bold;
    overflow: hidden;
  }

  a {
    text-decoration: none;
  }

  .navItem[aria-current] {
    font-weight: bold;
  }
</style>
