import React, { useRef, useState } from "react"; import InputDetails from "./IntroDetails"; import OTPSection from "./OtpSection"; import SpouseDetails from "./SpouseDetails"; import { Button } from ".."; // interface Option { // value: string; // label: string; // } interface BasicInfoProps { inputValues: { title: string; marital: string; agentId: string; bvn: string; firstName: string; phone: string; email: string; surname: string; dob: string; secondName: string; spouseBVN: string; }; setInputValues: React.Dispatch>; handleNextStep: any; } const BasicInfo: React.FC = ({ inputValues, setInputValues, handleNextStep, }) => { const [hideOTPComponent, setHideOTPComponent] = useState(true); const inputRef = useRef(null); const handleChange = (e: React.FormEvent) => { const { name, value } = e.target as HTMLInputElement; setInputValues((prev: typeof inputValues) => ({ ...prev, [name]: value })); }; const handleInput = (e: React.FormEvent) => { const { name, value } = e.target as HTMLInputElement; if (name === "bvn") { const isNumeric = /^[0-9]+$/.test(value); if (isNumeric) { if (value.length === 10) { setHideOTPComponent(false); } else { setHideOTPComponent(true); } } else { console.log("Invalid BVN"); } } }; return ( <> {/* Header */}

Let’s Get You Started

{!hideOTPComponent && ( <>