From 8f933b3ba5d0e615b1eaa039dcd3a521d7307a09 Mon Sep 17 00:00:00 2001 From: Sidney Date: Sun, 19 Jul 2026 22:45:17 -0300 Subject: [PATCH] feat: popup alerta de telefone obrigatorio, sincronismo automatico de clientes online/app e horarios de atendimento por dia/profissional --- src/app/[slug]/agendar/page.tsx | 59 ++++++++++++++- src/app/api/tenant/agenda/route.ts | 23 ++++++ src/app/api/tenant/clients/route.ts | 21 +++++- src/app/api/tenant/settings/route.ts | 4 + src/components/Settings.tsx | 106 ++++++++++++++++++++++----- 5 files changed, 193 insertions(+), 20 deletions(-) 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 ) : ( - )} + {/* 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. +

+
+ + setClientPhone(e.target.value)} + /> +
+ +
+
+
+ )} + {/* FOOTER */}