import { Button, InputCompOne, Stepper } from ".."; import {Formik, Form} from 'formik' import * as Yup from "yup"; type Props = { handleNextStep:(value:{})=>any } const initialValues = { loan_amount: "", payment_month: "", sales_agent: "", }; // To get the validation schema const validationSchema = Yup.object().shape({ payment_month: Yup.string() .required("Required"), loan_amount: Yup.string() .required("Required") .test("no-e", "Invalid", (value:any) => { if (value && /^[0-9]*$/.test(value) == false) { return false; } return true; }), sales_agent: Yup.string() }); export default function DashboardFormInit({handleNextStep}:Props) { //FUNCTION TO HANDLE SUBMIT const handleSubmit = (values:{}) => { handleNextStep(values) }; return (
{(props)=>(
)}
); } interface SelectOption { loading: boolean; data: {value: string; label: string}[] } const paymentMonth: SelectOption = { loading: false, data: [ { value: "", label: "Please Select" }, { value: "6", label: "6 Months" }, { value: "12", label: "12 Months" }, { value: "18", label: "18 Months" }, { value: "24", label: "24 Months" }, ] }