<template>
  <main id="main" style="margin-top:-20px; padding-bottom:50px">
    <div class="container">
      <div class="row">
        <div class="col">
          <div class="section-header">
            <h2>Tender Week Admin</h2>
          </div>
        </div>
      </div>
      <div v-if="checkAccess" id="table" class="col-xs-12 table-responsive">
        <ListView :items="items" :showNew="false"></ListView>
      </div>
      <div v-else>
        <alert :text="'You don\'t have permission to view this page'" :type="'ERROR'" />
      </div>
    </div>
  </main>
</template>

<script>
/* eslint-disable */
import { mapState, mapActions } from "vuex";

import Log from "../../../assets/Log";
import alert from "../../shared/alert";
import ListView from "../../shared/listView.vue";

export default {
  name: "TenderWeekAdmin",
  created() {
    this.getItems();
  },
  components: {
    ListView,
    alert
  },
  computed: {
    ...mapState("tenderWeek", ["items"]),
    checkAccess() {
      if (Log.getUser().role === "Super Admin") {
        return true;
      } else {
        return false;
      }
    }
  },
  methods: {
    ...mapActions("tenderWeek", ["getItems"])
  }
};
</script>

<style></style>
