<template>
  <OptionTemplate :name="model.name" :required="model.required">
    <textarea
        type="text"
        class="textarea"
        :placeholder="model.name"
        v-text="model.value"
        @input="input(model, $event.target.value)"
    />
  </OptionTemplate>
</template>

<script setup>
import OptionTemplate from "./OptionTemplate.vue";

const model = defineModel();
const emit = defineEmits(['update:modelValue']);

function input(model, newValue) {
  model.value = newValue;
  emit('update:modelValue', model);
}
</script>
