'use client'; import { useRouter } from 'next/navigation'; import PresenceAnimator from '@/components/hox/PresenceAnimator'; import CustomInput from '@/components/CustomInput'; import { FormEvent, useContext, useState } from 'react'; import StepsContext from '@/context/StepsContext'; import { FormActionType } from '@/providers/StepsProvider'; import { Queries } from '@/api/queries'; import Button from '@/components/Button'; import Loader from '@/components/Loader'; import { Validator } from '@/utils/validator'; const WindowThree = () => { const { form, dispatch } = useContext(StepsContext).addPostContext; const [loading, setLoading] = useState(false); const router = useRouter(); const validateForm = () => { if ( Validator.email(form.customer_email) && Validator.isNotEmpty(form.customer_name) && Validator.phone(form.customer_phone) ) return true; else return false; }; if (loading == true) return ; return ( <>
{ e.preventDefault(); await Queries.postAdvert(form); }}>

Bukjany sargyt etmek üçin aşakdaky maglumatlary dolduryň

dispatch({ type: FormActionType.NAME, payload: newValue }), }} name="name" label="Ady" placeholder="Sargyt edijiniň ady ýa-da familiýasy" type="text" validate={{ errMsg: 'Name is required', isValid: Validator.isNotEmpty(form.customer_name), }} /> dispatch({ type: FormActionType.PHONE, payload: newValue }), }} name="phone" label="Telefon" placeholder="+993 61234567" type="text" validate={{ errMsg: 'Invalid phone number', isValid: Validator.phone(form.customer_phone), }} /> dispatch({ type: FormActionType.EMAIL, payload: newValue }), }} name="email" label="E-mail" placeholder="meselem@gmail.com" type="email" validate={{ errMsg: 'Invalid email address', isValid: Validator.email(form.customer_email), }} /> dispatch({ type: FormActionType.NOTES, payload: newValue }), }} isTextArea name="notes" label="Goşmaça bellikler" placeholder="Mahabat etmak isleäýän zadyňyzy barada şu ýerik ýazyň..." type="text" />

Jikme-jiklikleri bize{' '} mahabat@turkmen.gov.tm {' '} adrese iberiň

); }; export default WindowThree;