From fc1dd4b4d93b37cf97dea39a813ba433380a86da Mon Sep 17 00:00:00 2001 From: Naytitorn Chaovirachot Date: Fri, 11 Oct 2024 23:19:20 +0700 Subject: [PATCH] add base code for fetching input data to JSON --- src/app/business/apply/page.tsx | 51 +++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 21 deletions(-) diff --git a/src/app/business/apply/page.tsx b/src/app/business/apply/page.tsx index 7e4d166..96a7ce0 100644 --- a/src/app/business/apply/page.tsx +++ b/src/app/business/apply/page.tsx @@ -16,10 +16,14 @@ import { useEffect, useState } from "react"; export default function Apply() { let supabase = createSupabaseClient(); + + const [companyName, setCompanyName] = useState(""); + const [selectedIndustry, setSelectedIndustry] = useState(""); const [industry, setIndustry] = useState([]); + const [isInUS, setIsInUS] = useState(""); const [isForSale, setIsForSale] = useState(""); - const [isGenerating, setIsGenarting] = useState(""); + const [isGenerating, setIsGenerating] = useState(""); const [pitch, setPitch] = useState(""); const communitySize = [ "N/A", @@ -36,18 +40,25 @@ export default function Apply() { .from("BusinessType") .select("value"); - if (error) { + if (!BusinessType) { console.error(error); } else { - if (BusinessType) { - console.table(); - setIndustry(BusinessType.map((item) => item.value)); - } + setIndustry(BusinessType.map((item) => item.value)); } }; useEffect(() => { fetchIndustry(); }, []); + + /* temp */ + let format = { + "Company Name: ": companyName, + "Industry": selectedIndustry, + } + + /* TEMP log */ + const submitApplication = () => alert(JSON.stringify(format)); + return (
@@ -57,9 +68,7 @@ export default function Apply() {

All information submitted in this application is for internal use - only and is treated with the utmost{" "} -

-

+ only and is treated with the utmost {" "}
confidentiality. Companies may apply to raise with B2DVentures more than once.

@@ -68,7 +77,7 @@ export default function Apply() {

About your company

- All requested information in this section is required. + All requested information in this section are required.

{/* form */} @@ -76,10 +85,10 @@ export default function Apply() {
- + setCompanyName(event.target.value)} type="text" id="companyName" className="w-96" /> This should be the name your company uses on your
website and in the market. @@ -92,7 +101,7 @@ export default function Apply() { Industry
- setSelectedIndustry(value)}> @@ -100,7 +109,7 @@ export default function Apply() { Industry {industry.map((i) => ( - {i} + {i} ))} @@ -202,14 +211,14 @@ export default function Apply() {