<template>
  <div class="position-relative">
    <form action="">
      <div class="form-row">
        <label for="">عنوان </label>
        <span>{{ data.entity.title }}</span>
      </div>

      <div class="form-row">
        <label for="">بیان </label>
        <textarea
          v-model="value"
          name=""
          ref="text"
          cols="30"
          rows="30"
          placeholder="خلاصه‌ای از مشکل و اهمیت مسئله بدهید"
          style="overflow: auto"
        ></textarea>
      </div>

      <div class="popUp-tab__buttons">
        <div
         
          class="d-flex justify-content-between flex-grow-1"
        >
        <button
          class="btn delete-btn btn-outline-danger"
          @click.prevent="deleteProperty()"
        >
          حذف
        </button>
          <div data-v-e8ee7a26="" class="d-flex">
            <button
          title="لغو"
          @click.prevent="$emit('close-modal')"
          class="popUp-tab__clear btn"
          type="button"
        >
          لغو
        </button>
        <button
          type="button"
          class="popUp-tab__submit btn"
          @click.prevent="saveProperty()"
        >
          ثبت
        </button>
          </div>
        </div>

      </div>

    </form>
  </div>
</template>

<script>
import { propertyMixin } from "~/entity/mixins/propertyMixin";

export default {
  mixins: [propertyMixin],

  props: {
    data: { type: Object, default: () => ({}) },
  },
  mounted() {
    // this.value = ('description' in this.data.entity ) ?  this.data.entity['description'] : '';
    this.value = this.getPropertyValue(
      this.data.entity,
      this.data.keyName,
      this.data.index
    );
  },
  data() {
    return {
      value: "",
    };
  },
  computed: {
    // propertyObj() {
    //   if (this.data.property) {
    //     return this.data.property;
    //   } else {
    //     return this.property;
    //   }
    // },
  },

  
};
</script>
<style scoped>
.button_delete {
  position: absolute;
  z-index: 4444444;
  bottom: 16px;
}
</style>
