<template>
  <div>
    <div class="conainer">
      <div class="container">
        <div class="row">
          <div class="col-md-12 col-lg-8">
            <div class="title-box-d">
              <br />
              <h1 class="title-d" style="text-align:left; font-size: 250%">Restaurants</h1>
            </div>
          </div>
        </div>
        <div class="row"></div>
        <div class="row">
          <div class="col-md-12">
            <listView :items="restaurants" :displayColumns="columns" :showNew="false" />
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import listView from "../shared/listView";
import { mapState, mapActions } from "vuex";

export default {
  name: "Restaurants",
  components: {
    listView
  },
  data() {
    return {
      columns: ["name", "shoppingCentre", "suburb", "city"]
    };
  },
  methods: {
    ...mapActions("restaurant", ["getRestaurants"])
  },
  computed: {
    ...mapState("restaurant", ["restaurants"])
  },
  mounted() {
    this.getRestaurants();
  }
};
</script>