<template>
  <on-the-fly
    :type="context.type"
    :id="context.id"
    :action="context.action"
    :button-text="options.buttonText"
    :display-badge="options.displayBadge === 'true'"
    :is-dead="options.isDead"
    :parent="options.parent"
    @save-form-on-the-fly="saveFormOnTheFly"
  />
</template>

<script>
import OnTheFly from "./components/OnTheFly.vue";

export default {
  name: "App",
  components: {
    OnTheFly,
  },
  props: ["onTheFly"],
  computed: {
    context() {
      return this.onTheFly.context;
    },
    options() {
      return this.onTheFly.options;
    },
  },
  mounted() {
    //console.log('OnTheFly mounted');
    //console.log('OnTheFly: data context', this.context);
    //console.log('OnTheFly: data options', this.options);
  },
  methods: {
    saveFormOnTheFly(payload) {
      console.log("saveFormOnTheFly", payload);
    },
  },
};
</script>
