diff --git a/src/app/components/portfolio/UploadCsvModal.tsx b/src/app/components/portfolio/UploadCsvModal.tsx index 6a1bf89..ebe520c 100644 --- a/src/app/components/portfolio/UploadCsvModal.tsx +++ b/src/app/components/portfolio/UploadCsvModal.tsx @@ -14,12 +14,12 @@ import Link from "next/link"; export const SubmitPlan = ({ buttonDisabled, goal, - fundingScheme, + housingType, goalValue, }: { buttonDisabled: boolean; goal: string; - fundingScheme: string; + housingType: string; goalValue: string; }) => { const router = useRouter(); @@ -28,7 +28,7 @@ export const SubmitPlan = ({ const requestBody = JSON.stringify({ goal: goal, goalValue: goalValue, - fundingScheme: fundingScheme, + housingType: housingType, }); const response = await fetch("/api/portfolio/plan", { @@ -77,7 +77,7 @@ export function InputFile({ handleButtonDisabled, setCsvFile, selectedGoal, - fundingScheme, + housingType, goalValue, }: { handleButtonDisabled: ( @@ -88,7 +88,7 @@ export function InputFile({ ) => void; setCsvFile: (file: File) => void; selectedGoal: string; - fundingScheme: string; + housingType: string; goalValue: string; }) { function handleOnChange(e: React.ChangeEvent) { @@ -101,7 +101,7 @@ export function InputFile({ return; } setCsvFile(file); // Assuming you have a state to keep the file - handleButtonDisabled(selectedGoal, fundingScheme, goalValue, file); + handleButtonDisabled(selectedGoal, housingType, goalValue, file); } } @@ -182,23 +182,19 @@ export function SelectDropdown({ const hiddenInputArrows = "[-moz-appearance:_textfield] [&::-webkit-inner-spin-button]:m-0 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:m-0 [&::-webkit-outer-spin-button]:appearance-none"; -const selectFundingSchemeOptions = [ +const selecthousingTypeOptions = [ { - label: "None", - value: "None", + label: "Social", + value: "Social", disabled: false, }, { - label: "SHDF", - value: "SHDF", - disabled: false, - }, - { - label: "ECO4", - value: "ECO4", + label: "Private", + value: "Private", disabled: false, }, ]; + const selectGoalOptions = [ // { // label: "None", @@ -245,7 +241,7 @@ export default function UploadCsvModal({ const [buttonDisabled, setButtonDisabled] = useState(true); const [selectedGoal, setSelectedGoal] = useState(""); - const [fundingScheme, setFundingScheme] = useState(""); + const [housingType, sethousingType] = useState(""); const [goalValue, setGoalValue] = useState(""); const [csvFile, setCsvFile] = useState(null); @@ -260,7 +256,7 @@ export default function UploadCsvModal({ function handleButtonDisabled( goal?: string, - scheme?: string, + housetype?: string, value?: string, file?: File | null ) { @@ -269,7 +265,7 @@ export default function UploadCsvModal({ // will not have updated yet, so we need to pass in the value as an argument to check if the value has been updated if ( (goal || selectedGoal) && - (scheme || fundingScheme) && + (housetype || housingType) && (value || goalValue) && (file || csvFile) ) { @@ -354,14 +350,14 @@ export default function UploadCsvModal({ htmlFor="portfolio-name" className="text-sm font-semibold text-gray-600 mb-1 relative leading-relaxed tracking-wider" > - Funding Scheme + Housing type * { - setFundingScheme(option.value); + sethousingType(option.value); handleButtonDisabled( selectedGoal, option.value, @@ -384,7 +380,7 @@ export default function UploadCsvModal({ setSelectedGoal(option.value); handleButtonDisabled( option.value, - fundingScheme, + housingType, goalValue, csvFile ); @@ -406,7 +402,7 @@ export default function UploadCsvModal({ setGoalValue(option.value); handleButtonDisabled( selectedGoal, - fundingScheme, + housingType, option.value, csvFile ); @@ -422,9 +418,12 @@ export default function UploadCsvModal({ properties @@ -434,7 +433,7 @@ export default function UploadCsvModal({ handleButtonDisabled={handleButtonDisabled} setCsvFile={setCsvFile} selectedGoal={selectedGoal} - fundingScheme={fundingScheme} + housingType={housingType} goalValue={goalValue} /> @@ -451,7 +450,7 @@ export default function UploadCsvModal({