<template>
  <div>
    <h5 :style="{ color: widget.style.headingColor }">
      {{ widget.text.booleanHeading }}
    </h5>
    <span>{{ widget.text.booleansubHeading }}</span>
    <div class="d-flex justify-content-center">
      <div style="margin: 10px 40px">
        <button
          v-on:click="sendboolean(widget.text.booleanOption[true], 1)"
          class="btn-outline-success btn-block"
          style="
            border: solid 4px;
            border-radius: 100%;
            margin: 0 auto;
            width: 100px;
            height: 100px;
          "
          v-bind:class="{ active: trueActive }"
        >
          <!-- {{widget.text.booleanOption[true]}} -->
          <v-icon x-large>mdi-thumb-up</v-icon>
        </button>
      </div>
      <div style="margin: 10px 40px">
        <button
          v-on:click="sendboolean(widget.text.booleanOption[false], 0)"
          class="btn-outline-danger btn-block"
          style="
            border: solid 4px;
            border-radius: 100%;
            margin: 0 auto;
            width: 100px;
            height: 100px;
          "
          v-bind:class="{ active: falseActive }"
        >
          <!-- {{widget.text.booleanOption[false]}} -->

          <v-icon x-large>mdi-thumb-down</v-icon>
        </button>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "boolean",
  data: function () {
    return {
      trueActive: false,
      falseActive: false,
      notdisable: "",
      inputText: "",
      hover: false,
      highlight: false,
      top: false,
      bottom: false,
    };
  },
  props: {
    widget: Object,
  },

  methods: {
    sendboolean(value, id) {
      if (id == 1) {
        this.trueActive = true;
        this.falseActive = false;
        this.widget.value.Ans.id = id;
        this.widget.value.Ans.value = value;
      } else if (id == 0) {
        this.trueActive = false;
        this.falseActive = true;
        this.widget.value.Ans.id = id;
        this.widget.value.Ans.value = value;
      }
    },
  },
};
</script>

<style></style>
