import React, { useState } from 'react'; import axios from 'axios'; const OtpForm = () => { const [emailOtp, setEmailOtp] = useState(''); const [whatsappOtp, setWhatsappOtp] = useState(''); const [error, setError] = useState(''); const [loading, setLoading] = useState(false); const handleVerify = async (e) => { e.preventDefault(); setLoading(true); setError(''); try { // Assuming you have a webhook for OTP verification await axios.post('https://api.karyamanswasta.my.id/webhook/verify-otp/adventure', { emailOtp, whatsappOtp, }); // On success, you would typically redirect to the main app console.log('OTP verification successful'); } catch (err) { setError(err.response?.data?.message || 'OTP verification failed.'); } finally { setLoading(false); } }; return ( <>
Enter the OTP sent to your email and WhatsApp