<template>
  <div id="cartCheckout">
    <div class="buttons">
      <router-link to="/cart" class="button">Cart ({{ inCart }})</router-link>
      <router-link to="/checkout" class="button is-primary">
        Checkout
      </router-link>
    </div>
  </div>
</template>

<script>
export default {
  name: "CartCheckout",
  computed: {
    inCart() {
      return Object.values(this.$store.state.cart).reduce(
        (acc, cur) => acc + cur,
        0
      );
    }
  }
};
</script>
