diff --git a/src/app/[slug]/agendar/page.tsx b/src/app/[slug]/agendar/page.tsx index 2024a1c..c747fc9 100644 --- a/src/app/[slug]/agendar/page.tsx +++ b/src/app/[slug]/agendar/page.tsx @@ -127,7 +127,19 @@ export default function PublicBookingPage({ params }: { params: Promise<{ slug: return false; }; + const [showPhoneModal, setShowPhoneModal] = useState(false); + const handleBook = async () => { + if (!clientName.trim()) { + showToast('Por favor, informe o seu nome completo.', 'warning'); + return; + } + if (!clientPhone.trim()) { + showToast('É necessário informar o seu telefone para confirmar o agendamento!', 'error'); + setShowPhoneModal(true); + return; + } + const [startHour, startMin] = selectedTime ? selectedTime.split(':').map(Number) : [9, 0]; try { @@ -432,14 +444,57 @@ export default function PublicBookingPage({ params }: { params: Promise<{ slug: Próximo ) : ( - + Confirmar Agendamento )} + {/* MODAL POP-UP TELEFONE OBRIGATÓRIO */} + {showPhoneModal && ( + setShowPhoneModal(false)}> + e.stopPropagation()} style={{ maxWidth: '420px', textAlign: 'center' }}> + + + + + + + Telefone / WhatsApp Obrigatório 📱 + + Por favor, informe o seu número de telefone ou WhatsApp para confirmarmos e enviarmos a nota do seu agendamento. + + + Seu Telefone / WhatsApp * + setClientPhone(e.target.value)} + /> + + { + if (!clientPhone.trim()) { + showToast('Por favor, digite seu número de telefone.', 'warning'); + return; + } + setShowPhoneModal(false); + handleBook(); + }} + > + Confirmar e Agendar + + + + + )} + {/* FOOTER */}
+ Por favor, informe o seu número de telefone ou WhatsApp para confirmarmos e enviarmos a nota do seu agendamento. +