<template>
  <form-input
    modelKey="firstName"
    v-model="customerIrtibatStore.customerIrtibatForm.firstName"
    required
    label="Ad"
    minlength="2"
    :invalidText="customerIrtibatValidationStore.invalidTexts.firstName"
    @keydown="validationStore.allowLettersWithKeysExtra($event, /^[ ]*$/)" />

  <form-input
    modelKey="lastName"
    v-model="customerIrtibatStore.customerIrtibatForm.lastName"
    required
    label="Soyadı"
    minlength="2"
    :invalidText="customerIrtibatValidationStore.invalidTexts.lastName"
    @keydown="validationStore.allowLettersWithKeysExtra($event, /^[ ]*$/)" />

  <form-input
    type="email"
    modelKey="email"
    v-model="customerIrtibatStore.customerIrtibatForm.email"
    required
    label="E-posta adresi"
    placeholder="eposta@alanadi.com"
    :invalidText="customerIrtibatValidationStore.invalidTexts.email" />

  <form-input
    type="tel"
    modelKey="phone"
    v-model="customerIrtibatStore.customerIrtibatForm.phone"
    required
    label="Telefon Numarası"
    placeholder="5554443322"
    @keydown="validationStore.allowNumbersWithKeys"
    maxlength="10"
    minlength="10"
    :invalidText="customerIrtibatValidationStore.invalidTexts.phone" />
</template>
<script setup lang="ts">
  import { useValidationStore } from '@/stores/validationStore'
  const validationStore = useValidationStore()
  import { useCustomerIrtibatStore } from '../../stores/customerIrtibatStore'
  const customerIrtibatStore = useCustomerIrtibatStore()
  import { useCustomerIrtibatValidationStore } from '../../validation/customerIrtibatValidationStore'
  const customerIrtibatValidationStore = useCustomerIrtibatValidationStore()
</script>
