<template>
  <v-runtime-template :template="viewHTML" :class="[componentClass, templateName]"></v-runtime-template>
</template>

<script>

import { mapGetters } from 'vuex'
import { deviceDetection } from '../mixins/c-device-detection'
import { utilsMixin } from '../mixins/c-utils-mixin'
import { windowsMixin } from "../mixins/c-windows-mixin"


const props = {
  appWindowIdent: {
    type: String,
    default: null,
    required: true
  },
  templateName: {
    type: String,
    default: null,
    required: true
  }
}

export default {
  props: props,
  mixins: [deviceDetection, windowsMixin, utilsMixin],
  data: function() {
    return {
      componentClass: "c-app-window-part"
    }
  },
  computed: {
    ...mapGetters('csAppWindowsUtils', [
      'getAppWindowPartViewHTML'
    ]),
    viewHTML: function () {
      return this.getAppWindowPartViewHTML(this.appWindowIdent, this.templateName)
    }
  }
};
</script>