<template>
    <v-row class="pl-10 pr-10">
      <v-col cols="12" sm="12" md="12" lg="12" class="">
        <div class="h3 text-capitalize body-font1">Retailer dashboard</div>
        <!-- <div class="fontsize-18 py-5">
          <b>Holiday Cutoff:</b> The deadline to submit your personalized order
          to receive in time for christmas exired on 12/1.
        </div> -->

      <span v-if="homePage && homePage.content">
        <div v-html="homePage.content"></div>
      </span> 
      </v-col>
    </v-row>
</template>

<script>
//import { mapState } from "vuex";

import { createHelpers } from "vuex-map-fields";
import { loginInterrupt } from "@/services/nav";

const { mapFields } = createHelpers({
  getterType: "accountOne/getField",
  mutationType: "accountOne/updateField",
});
export default {
  name: "AccountDashboard",
  data() {
    return {
      hideShow: false,
    };
  },
   computed: {
    homePage: function () {
      let data = null;
      let blockContent = this.$store.state.layout.cmsBlockContent;
      if (blockContent.length) {
        data = blockContent.filter((element) => {
          return element.identifier === "retailer-homepage-blocks";
        })[0];
      }

      return data;
    },
    ...mapFields(["newsLetterSubscription", "addressIndex"]),
    userAuth: function () {
      return this.$store.state.auth.userAuth;
    },
  },
  created() {
    if (!this.userAuth) {
      loginInterrupt(
        window.location.href,
        "There was an access violation caused by your request. You need to sign back in please."
      );
    }
    this.$store.dispatch("accountOne/basicInfo");
    this.hideShow = true;
    setTimeout(() => {
      this.hideShow = false;
    }, 2000);
  },
};
</script>
