diff --git a/src/components/ContactSection.tsx b/src/components/ContactSection.tsx index cbad220..cca8c95 100644 --- a/src/components/ContactSection.tsx +++ b/src/components/ContactSection.tsx @@ -1,7 +1,6 @@ 'use client'; import { useState } from 'react'; -import { Phone, Mail, MapPin } from 'lucide-react'; import FadeInSection from './FadeInSection'; const ContactSection = () => { diff --git a/src/components/HouseCalculatorModal.tsx b/src/components/HouseCalculatorModal.tsx index d8c78f5..8513538 100644 --- a/src/components/HouseCalculatorModal.tsx +++ b/src/components/HouseCalculatorModal.tsx @@ -1,8 +1,7 @@ 'use client'; import { useState } from 'react'; -import { X, CheckCircle, AlertCircle } from 'lucide-react'; -import Image from 'next/image'; +import { X, ChevronLeft, ChevronRight, Check } from 'lucide-react'; const materials = [ { label: 'Кирпич/керамический блок', value: 'Кирпич/керамический блок', img: '/images/keramic.jpg' }, @@ -17,19 +16,6 @@ const areas = [ 'более 200 кв.м.', ]; -const finishes = [ - 'Без отделки', - 'Черновая отделка (стяжка, штукатурка и тд)', - 'Чистовая отделка (обои, ламинат и тд)', -]; - -const finances = [ - 'Наличные', - 'Сельская ипотека', - 'Ипотека, кредит', - 'Свой вариант', -]; - interface HouseCalculatorModalProps { isOpen: boolean; onClose: () => void; @@ -43,22 +29,17 @@ const HouseCalculatorModal = ({ isOpen, onClose, userName = '', userPhone = '' } const [area, setArea] = useState(''); const [finish, setFinish] = useState(''); const [finance, setFinance] = useState(''); - const [error, setError] = useState(''); const [isSubmitting, setIsSubmitting] = useState(false); if (!isOpen) return null; const handleNext = () => { - setError(''); - if (step === 1 && !material) return setError('Выберите материал'); - if (step === 2 && !area) return setError('Выберите площадь'); - if (step === 3 && !finish) return setError('Выберите вариант отделки'); - if (step === 4 && !finance) { - setError('Выберите источник финансирования'); - return; - } + if (step === 1 && !material) return; + if (step === 2 && !area) return; + if (step === 3 && !finish) return; + if (step === 4 && !finance) return; + if (step === 4) { - // После 4-го шага отправляем данные в Telegram и переходим к 5-му шагу handleSubmitCalculator(); return; } @@ -66,16 +47,13 @@ const HouseCalculatorModal = ({ isOpen, onClose, userName = '', userPhone = '' } }; const handlePrev = () => { - setError(''); setStep((s) => s - 1); }; const handleSubmitCalculator = async () => { - // Защита от двойной отправки if (isSubmitting) return; setIsSubmitting(true); - setError(''); try { const res = await fetch('/api/send-telegram', { @@ -92,12 +70,10 @@ const HouseCalculatorModal = ({ isOpen, onClose, userName = '', userPhone = '' } }); if (res.ok) { - setStep(5); // Переходим к 5-му шагу - } else { - setError('Ошибка отправки. Попробуйте позже.'); + setStep(5); } } catch { - setError('Ошибка отправки. Попробуйте позже.'); + // Обработка ошибки } finally { setIsSubmitting(false); } @@ -109,7 +85,6 @@ const HouseCalculatorModal = ({ isOpen, onClose, userName = '', userPhone = '' } setArea(''); setFinish(''); setFinance(''); - setError(''); setIsSubmitting(false); onClose(); }; @@ -157,21 +132,14 @@ const HouseCalculatorModal = ({ isOpen, onClose, userName = '', userPhone = '' } : 'border-white/20 hover:border-white/40' }`} > - {/* Фон при активном состоянии */}
-
- {m.icon} -

- {m.name} + {m.label}

-

- {m.description} -

))} @@ -208,30 +176,22 @@ const HouseCalculatorModal = ({ isOpen, onClose, userName = '', userPhone = '' } {step === 3 && (

- Дополнительные опции + Выберите тип отделки

-
- {options.map((option) => ( -