<template>
  <q-page padding>
    <q-card class="my-card" v-if="currentProject">
      <q-card-section> Lorem ipsum dolor sit amet </q-card-section>
      <q-card-section> {{ projectUuid }}</q-card-section>
      <q-card-section>
        {{ currentProject.nomo.enhavo }}
      </q-card-section>
    </q-card>
  </q-page>
</template>

<script lang="ts">
import { useKanvasoStore } from '../stores/kanvaso';
import { mapActions, mapState } from 'pinia';
import { defineComponent } from 'vue';

export default defineComponent({
  // name: 'PageName'
  computed: {
    ...mapState(useKanvasoStore, { project: 'getKanvaso' }),
    currentProject() {
      return this.project ? this.project[0].node : null;
    },
    projectUuid() {
      return this.$route?.params?.uuid || '';
    },
  },
  methods: {
    ...mapActions(useKanvasoStore, ['onGetKanvaso']),
  },
  mounted() {
    this.onGetKanvaso({ uuid: this.projectUuid });
  },
});
</script>
