<script setup lang="ts">
import { ref } from 'vue'
const props = defineProps({
  colorfulSrc: String,
  isshowexpression: Boolean,
  isshowDetails: Boolean
})
const inputdetails = ref('')
const emits = defineEmits(['submitDetails'])
const submitDetails = (val: any) => {
  emits('submitDetails', val)
}
</script>
<template>
  <div class="colorfulflex">
    <div v-if="props.isshowexpression" class="dialogcolorful">
      <div class="dialogue">
        <img :src="props.colorfulSrc" />
      </div>
      <div class="vector">
        <img class="vector_img" src="../image/bubble_corner_colorful.png" />
      </div>
    </div>
    <div v-if="props.isshowDetails" class="dialogcolorful submit">
      <div class="dialogue dialoguesubmit">
        <el-input
          class="inputdetails"
          v-model="inputdetails"
          style="width: 554px"
          :rows="4"
          type="textarea"
          placeholder="We look forward to hearing from you. Thank you for helping to build a better customer system."
        />
        <div class="button_submit">
          <el-button class="submit_button el-button--dark" @click="submitDetails(inputdetails)"
            >Submit</el-button
          >
        </div>
      </div>
      <div class="vector vector_submit">
        <img class="vector_img" src="../image/bubble_corner_colorful.png" />
      </div>
    </div>
  </div>
</template>
<style lang="scss" scoped>
.colorfulflex {
  display: flex;
  justify-content: end;
  margin-bottom: 8px;
}
.dialogcolorful {
  width: 56px;
  display: flex;
  flex-direction: column;
}
.submit {
  width: 570px;
  margin: auto;
}
.dialogue {
  color: var(--tag-info-text-color);
  font-size: var(--font-size-4);
  border-radius: var(--border-radius-12) var(--border-radius-12) 0 var(--border-radius-12);
  background: linear-gradient(251deg, rgba(242, 244, 247) 0%, rgba(255, 237, 230) 100%);
  padding: 8px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dialoguesubmit {
  width: 570px;
  display: block;
  height: auto;
}
.vector {
  width: 56px;
  height: 8px;
  display: flex;
  justify-content: end;
}
.vector_submit {
  width: 570px;
}
.vector_img {
  vertical-align: top;
}
:deep(.el-textarea) {
  .el-textarea__inner {
    resize: none; // 去除右下角图标
    padding: 5px 7px 5px 10px;
  }
}
.submit_button {
  width: 180px;
  height: 40px;
}
.button_submit {
  width: 553px;
  margin-top: 9.51px;
  display: flex;
  justify-content: end;
}
:deep(.el-button > span) {
  color: #ffffff !important;
  font-weight: 400;
  font-size: var(--font-size-3);
}
</style>