From f68100a5c530a383e6d0850626c35b50bb43e0aa Mon Sep 17 00:00:00 2001 From: John Doe Date: Tue, 12 Sep 2023 17:36:57 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=89=20Added=20initial=20code=20structu?= =?UTF-8?q?re.=20=F0=9F=9A=80=20Implemented=20dynamic=20content=20renderin?= =?UTF-8?q?g.=20=F0=9F=92=A1=20Optimized=20component=20selection=20logic.?= =?UTF-8?q?=20=F0=9F=94=84=20Updated=20component=20imports.=20=F0=9F=94=A7?= =?UTF-8?q?=20Fixed=20switch-case=20logic=20for=20stepIndex.=20=E2=9C=A8?= =?UTF-8?q?=20Added=20support=20for=20PageAddListing10.=20=F0=9F=A9=B9=20M?= =?UTF-8?q?inor=20code=20improvements=20and=20clean-up.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/add-listing/[[...stepIndex]]/page.tsx | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 src/app/add-listing/[[...stepIndex]]/page.tsx diff --git a/src/app/add-listing/[[...stepIndex]]/page.tsx b/src/app/add-listing/[[...stepIndex]]/page.tsx new file mode 100644 index 0000000..b73ce98 --- /dev/null +++ b/src/app/add-listing/[[...stepIndex]]/page.tsx @@ -0,0 +1,61 @@ +import React from "react"; +import PageAddListing1 from "./PageAddListing1"; +import PageAddListing10 from "./PageAddListing10"; +import PageAddListing2 from "./PageAddListing2"; +import PageAddListing3 from "./PageAddListing3"; +import PageAddListing4 from "./PageAddListing4"; +import PageAddListing5 from "./PageAddListing5"; +import PageAddListing6 from "./PageAddListing6"; +import PageAddListing7 from "./PageAddListing7"; +import PageAddListing8 from "./PageAddListing8"; +import PageAddListing9 from "./PageAddListing9"; + +const Page = ({ + params, + searchParams, +}: { + params: { stepIndex: string }; + searchParams?: { [key: string]: string | string[] | undefined }; +}) => { + let ContentComponent = PageAddListing1; + switch (Number(params.stepIndex)) { + case 1: + ContentComponent = PageAddListing1; + break; + case 2: + ContentComponent = PageAddListing2; + break; + case 3: + ContentComponent = PageAddListing3; + break; + case 4: + ContentComponent = PageAddListing4; + break; + case 5: + ContentComponent = PageAddListing5; + break; + case 6: + ContentComponent = PageAddListing6; + break; + case 7: + ContentComponent = PageAddListing7; + break; + case 8: + ContentComponent = PageAddListing8; + break; + case 9: + ContentComponent = PageAddListing9; + break; + case 10: + ContentComponent = PageAddListing10; + break; + + default: + ContentComponent = PageAddListing1; + break; + } + + return ; +}; + +export default Page;