import { Button, InputCompOne, Stepper } from ".."; import {Formik, Form} from 'formik' import * as Yup from "yup"; type Props = { handleNextStep:()=>any } const initialValues = { amount: "", duration: "", id: "", }; // To get the validation schema const validationSchema = Yup.object().shape({ duration: Yup.string() .required("Required"), amount: Yup.string() .required("Required") .test("no-e", "Invalid", (value:any) => { if (value && /^[0-9]*$/.test(value) == false) { return false; } return true; }), id: Yup.string() .required("Required") }); export default function DashboardFormInit({handleNextStep}:Props) { //FUNCTION TO HANDLE SUBMIT const handleSubmit = (values:any) => { console.log(values) handleNextStep() }; return (
{(props)=>(
)}
); } interface SelectOption { loading: boolean; data: {value: string; label: string}[] } const duration: 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" }, ] }