<template>
  <div class="assist-input-wrapper flex flex-col">
    <textarea
      class="input"
      type="text"
      v-model="inputValue"
      :placeholder="$t('Input.placeholder')"
    />
    <div class="operate flex align-center">
      <div class="attach flex flex-center">
        <img src="@/assets/icons/attach.svg" alt="" />
      </div>
      <el-select v-model="typeValue" :placeholder="$t('Input.selectPlaceholder')">
        <el-option
          v-for="item in typeOptions"
          class="input-option"
          :key="item.value"
          :label="$t(item.label)"
          :value="item.value"
        />
      </el-select>
      <el-select v-model="areaValue" :placeholder="$t('Input.selectPlaceholder')">
        <el-option
          v-for="item in areaOptions"
          class="input-option"
          :key="item.value"
          :label="$t(item.label)"
          :value="item.value"
        />
      </el-select>
      <el-select v-model="styleValue" :placeholder="$t('Input.selectPlaceholder')">
        <el-option
          v-for="item in styleOptions"
          class="input-option"
          :key="item.value"
          :label="$t(item.label)"
          :value="item.value"
        />
      </el-select>
    </div>
  </div>
</template>

<script setup lang="ts">
import { computed, ref } from 'vue'
import { areaList } from '@/utils/area'

const inputValue = ref<string>('')

const typeValue = ref<string>('')
const areaValue = ref<string>('')
const styleValue = ref<string>('')
const typeOptions = ref<any[]>([
  {
    label: 'Input.types.sofa',
    value: 'Sofa'
  },
  {
    label: 'Input.types.desk',
    value: 'Desk'
  },
  {
    label: 'Input.types.chair',
    value: 'Chair'
  }
])
const areaOptions = ref<any[]>(areaList)
const styleOptions = ref<any[]>([
  {
    label: 'Input.styles.modern',
    value: 'Modern'
  },
  {
    label: 'Input.styles.classic',
    value: 'Classic'
  }
])
</script>

<style lang="less" scoped>
.assist-input-wrapper {
  height: 23.5rem;
  width: 106.3rem;
  border-radius: 2.8rem;
  background-color: #fff;
  border: 0.1rem solid #00000005;
  box-shadow: 0px 5px 14px 0px #0000001a;
  margin: 0 auto;
  padding: 3.4rem 1.7rem 1.7rem 2rem;
  .input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0 1.4rem;
    font-size: 2rem;
    font-family: 'InterRegular';
    font-weight: 400;
    color: #000000;
    resize: none;
  }
  .operate {
    column-gap: 2rem;
    .attach {
      width: 4rem;
      height: 4rem;
      border: 1px solid rgba(0, 0, 0, 0.1);
      border-radius: 50%;
    }
    .el-select {
      width: 13.9rem;
      height: 4rem;
      :deep(.el-select__wrapper) {
        border-radius: 0.8rem;
        height: 100%;
        box-shadow: none;
        border: 0.1rem solid rgba(0, 0, 0, 0.1);
        font-family: 'GeneralMedium';
        font-weight: 500;
        font-size: 1.4rem;
        .el-select__placeholder {
          color: #000;
        }
        .el-select__icon {
          color: #000;
        }
      }
    }
  }
}
.input-option {
  // padding: 0 1rem;
  margin: 0 0.6rem;
  padding: 0 0.8rem 0 1rem;
  color: #0d0d0d;
  font-weight: 510;
  font-size: 1.3rem;
  height: 3rem;
  line-height: 3rem;
  &.el-select-dropdown__item.is-hovering {
    background-color: rgba(13, 13, 13, 0.02);
    // border-radius: 0.6rem;
  }
}
</style>
