<template>
  <div class="collect-quote">
    <div class="collect-quote__backdrop" />
    <div class="collect-quote__container">
      <div class="collect-quote__quote-container">
        <div class="collect-quote__title">Preview:</div>
        <div class="collect-quote__quote">
          <Quote :text="quote.quote" />
        </div>
      </div>
      <div class="collect-quote__inputgroup">
        <form>
          <input type="hidden" name="id" :value="quote.id" />
          <textarea v-model="quote.quote" cols="60" rows="4" />
        </form>
        <button @click="save">Save</button>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: ['quote'],
  methods: {
    save() {
      this.$nuxt.$emit('save-quote', this.quote)
    }
  },
}
</script>

<style lang="scss">
.collect-quote {
  color: #ffffff;

  &__backdrop {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
  }

  &__container {
    position: absolute;
    display: flex;
    left: 10%;
    top: 15%;
    width: 80%;
    height: 400px;
    background-color: #402080;
    border: 1px solid #ffffff;
    border-radius: 20px;
  }

  &__quote-container {
    position: relative;
    display: flex;
    flex-direction: column;
    left: 0;
    top: 0;
    width: 50%;
    height: 100%;
    border-right: 1px solid #ffffff;
    padding: 48px;
  }

  &__title {
    font-size: 32px;
    font-family: "Wendy One";
    margin-bottom: 16px;
  }

  &__quote {
    align-self: center;
    max-width: 400px;
  }

  &__inputgroup {
  }
}
</style>
