diff --git a/src/app/business/apply/page.tsx b/src/app/business/apply/page.tsx index 752b3b9..742acf9 100644 --- a/src/app/business/apply/page.tsx +++ b/src/app/business/apply/page.tsx @@ -30,7 +30,7 @@ export default function Apply() { const [selectedIndustry, setSelectedIndustry] = useState(""); const [isInUS, setIsInUS] = useState(""); const [isForSale, setIsForSale] = useState(""); - const [isGenerating, setIsGenarting] = useState(""); + const [isGenerating, setIsGenerating] = useState(""); const [businessPitch, setBusinessPitch] = useState(""); const [projectType, setProjectType] = useState([]); const [projectPitch, setProjectPitch] = useState(""); @@ -59,11 +59,24 @@ export default function Apply() { }; const onSubmit = (data: any) => { - alert(JSON.stringify(data)); + console.table(data); }; - const handleSelectChange = (value: string) => { - setSelectedIndustry(value); - setValue("industry", value); + const handleFieldChange = (fieldName: string, value: string) => { + switch (fieldName) { + case "industry": + setSelectedIndustry(value); + break; + case "isInUS": + setIsInUS(value); + break; + case "isForSale": + setIsForSale(value); + break; + case "isGenerating": + setIsGenerating(value); + break; + } + setValue(fieldName, value); }; const fetchIndustry = async () => { let { data: BusinessType, error } = await supabase @@ -147,7 +160,11 @@ export default function Apply() { Industry
- + handleFieldChange("industry", value) + } + > @@ -184,7 +201,7 @@ export default function Apply() { id="totalRaised" className="w-96" placeholder="$ 1,000,000" - {...register} + {...register("totalRaised")} /> The sum total of past financing, including angel or venture{" "} @@ -204,7 +221,7 @@ export default function Apply() { +
Only companies that are incorporated or formed in the US are{" "} @@ -239,7 +257,7 @@ export default function Apply() {