<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%">Customers</h1>
            </div>
          </div>
        </div>
        <div class="row"></div>
        <div class="row">
          <div class="col-md-12">
            <listView :items="users" :displayColumns="columns" :showNew="false" />
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

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

export default {
  name: "Customers",
  components: {
    listView
  },
  data() {
    return {
      columns: ["emailAddress", "firstName", "surname", "cellphone"]
    };
  },
  methods: {
    ...mapActions("user", ["getUsers"])
  },
  computed: {
    ...mapState("user", ["users"])
  },
  mounted() {
    this.getUsers();
  }
};
</script>