import wixData from 'wix-data'; import wixLocation from 'wix-location'; $w.onReady(function () { $w('#successText').hide(); $w('#submitButton').onClick(async () => { const lead = { fullName: $w('#inputName').value, phone: $w('#inputPhone').value, email: $w('#inputEmail').value, address: $w('#inputAddress').value, projectType: $w('#dropdownProjectType').value, stage: $w('#dropdownStage').value, details: $w('#inputDetails').value, createdAt: new Date() }; if (!lead.fullName || !lead.phone || !lead.projectType || !lead.stage) { $w('#successText').text = 'Please fill in the required fields.'; $w('#successText').show(); return; } try { await wixData.insert('Leads', lead); $w('#successText').text = 'Thank you. Your request was submitted successfully.'; $w('#successText').show(); const smsMessage = encodeURIComponent( `Hi, my name is ${lead.fullName}. I want to book a free consultation. Project type: ${lead.projectType}. Stage: ${lead.stage}.` ); setTimeout(() => { wixLocation.to(`sms:13107135402?body=${smsMessage}`); }, 1200); } catch (error) { console.error(error); $w('#successText').text = 'Something went wrong. Please text us at 310-713-5402.'; $w('#successText').show(); } }); }); import Navbar from "@/components/Navbar"; import HeroSection from "@/components/HeroSection"; import ServicesSection from "@/components/ServicesSection"; import PortfolioSection from "@/components/PortfolioSection"; import WhyAtlasSection from "@/components/WhyAtlasSection"; import Title24Section from "@/components/Title24Section"; import ContactSection from "@/components/ContactSection"; import Footer from "@/components/Footer"; const Index = () => ( <>