<template lang="pug">
  base-input(
    :type="choiceType"
    v-model="value",
    :placeholder="placeholder",
    :maxLength="maxLength",
    :mask="sharp",
    :autogrow="choiceGrow"
  )
    slot
</template>

<script>
import BaseInput from "@/components/base/BaseInput";

export default {
  name: "ClientDetailInput",
  components: { BaseInput },
  emits: ["update:modelValue"],
  props: {
    modelValue: String,
    sharp: String,
    maxLength: String,
    placeholder: String,
  },
  computed: {
    choiceType() {
      return !this.sharp ? "textarea" : "text";
    },
    choiceGrow() {
      return !this.sharp ? true : false;
    },
    value: {
      get() {
        return this.modelValue;
      },
      set(value) {
        this.$emit("update:modelValue", value);
      },
    },
  },
};
</script>
