From cdc8cde6a490559f2b7ec8b7d4eb8de496590dbf Mon Sep 17 00:00:00 2001 From: AmirReza Jamali Date: Sun, 9 Nov 2025 14:53:36 +0330 Subject: [PATCH] feat(marketing): Refactor marketing wizard steps and add data collection methods - Moved all marketing wizard step components to `create/_components` directory - Added `collectData` static method to each step component for data retrieval - Reorganized file structure to improve component modularity - Prepared steps for dynamic data collection in wizard workflow - Added VSCode settings file for project configuration - Introduced new CMS-related components and services - Updated API endpoints and added new query hooks --- .../{ => create}/_components/BenefitsStep.tsx | 0 .../_components/ChallengesStep.tsx | 5 + .../{ => create}/_components/ChartPreview.tsx | 0 .../{ => create}/_components/ChartStep.tsx | 5 + .../{ => create}/_components/ContactsStep.tsx | 10 ++ .../{ => create}/_components/FeaturesStep.tsx | 5 + .../{ => create}/_components/FooterStep.tsx | 7 +- .../{ => create}/_components/HeroStep.tsx | 5 + .../{ => create}/_components/SectionStep.tsx | 0 .../_components/useBenefitsStepPresenter.ts | 0 .../_components/useChallengesStepPresenter.ts | 9 +- .../_components/useChartStepPresenter.ts | 7 ++ .../_components/useContactsStepPresenter.ts | 8 ++ .../_components/useFeaturesStepPresenter.ts | 9 +- .../_components/useFooterStepPresenter.ts | 9 +- .../_components/useHeroStepPresenter.ts | 7 ++ src/app/marketing/create/page.tsx | 112 ++++++++++++++++++ src/app/marketing/page.tsx | 61 +--------- src/components/Auth/Signin/index.tsx | 2 - src/components/HOC/EmptyListWrapper.tsx | 30 +++++ src/components/Tables/cms/index.tsx | 39 ++++++ .../Tables/cms/useCmsTablePresenter.ts | 15 +++ src/hooks/queries/useCmsQueries.ts | 22 ++++ src/lib/api/endpoints.ts | 3 + src/lib/api/services/cms-service.ts | 23 ++++ src/lib/api/types/TCms.ts | 84 +++++++++++++ 26 files changed, 414 insertions(+), 63 deletions(-) rename src/app/marketing/{ => create}/_components/BenefitsStep.tsx (100%) rename src/app/marketing/{ => create}/_components/ChallengesStep.tsx (86%) rename src/app/marketing/{ => create}/_components/ChartPreview.tsx (100%) rename src/app/marketing/{ => create}/_components/ChartStep.tsx (97%) rename src/app/marketing/{ => create}/_components/ContactsStep.tsx (92%) rename src/app/marketing/{ => create}/_components/FeaturesStep.tsx (86%) rename src/app/marketing/{ => create}/_components/FooterStep.tsx (93%) rename src/app/marketing/{ => create}/_components/HeroStep.tsx (97%) rename src/app/marketing/{ => create}/_components/SectionStep.tsx (100%) rename src/app/marketing/{ => create}/_components/useBenefitsStepPresenter.ts (100%) rename src/app/marketing/{ => create}/_components/useChallengesStepPresenter.ts (89%) rename src/app/marketing/{ => create}/_components/useChartStepPresenter.ts (87%) rename src/app/marketing/{ => create}/_components/useContactsStepPresenter.ts (91%) rename src/app/marketing/{ => create}/_components/useFeaturesStepPresenter.ts (88%) rename src/app/marketing/{ => create}/_components/useFooterStepPresenter.ts (82%) rename src/app/marketing/{ => create}/_components/useHeroStepPresenter.ts (76%) create mode 100644 src/app/marketing/create/page.tsx create mode 100644 src/components/HOC/EmptyListWrapper.tsx create mode 100644 src/components/Tables/cms/index.tsx create mode 100644 src/components/Tables/cms/useCmsTablePresenter.ts create mode 100644 src/hooks/queries/useCmsQueries.ts create mode 100644 src/lib/api/services/cms-service.ts create mode 100644 src/lib/api/types/TCms.ts diff --git a/src/app/marketing/_components/BenefitsStep.tsx b/src/app/marketing/create/_components/BenefitsStep.tsx similarity index 100% rename from src/app/marketing/_components/BenefitsStep.tsx rename to src/app/marketing/create/_components/BenefitsStep.tsx diff --git a/src/app/marketing/_components/ChallengesStep.tsx b/src/app/marketing/create/_components/ChallengesStep.tsx similarity index 86% rename from src/app/marketing/_components/ChallengesStep.tsx rename to src/app/marketing/create/_components/ChallengesStep.tsx index 775f091..9ed7a3f 100644 --- a/src/app/marketing/_components/ChallengesStep.tsx +++ b/src/app/marketing/create/_components/ChallengesStep.tsx @@ -33,3 +33,8 @@ const ChallengesStep = () => { }; export default ChallengesStep; + +ChallengesStep.collectData = async () => { + const { getValues } = useChallengesStepPresenter(); + return getValues(); +} diff --git a/src/app/marketing/_components/ChartPreview.tsx b/src/app/marketing/create/_components/ChartPreview.tsx similarity index 100% rename from src/app/marketing/_components/ChartPreview.tsx rename to src/app/marketing/create/_components/ChartPreview.tsx diff --git a/src/app/marketing/_components/ChartStep.tsx b/src/app/marketing/create/_components/ChartStep.tsx similarity index 97% rename from src/app/marketing/_components/ChartStep.tsx rename to src/app/marketing/create/_components/ChartStep.tsx index 23d455c..d69733d 100644 --- a/src/app/marketing/_components/ChartStep.tsx +++ b/src/app/marketing/create/_components/ChartStep.tsx @@ -125,3 +125,8 @@ const ChartStep = () => { }; export default ChartStep; + +ChartStep.collectData = async () => { + const { getValues } = useChartStepPresenter(); + return getValues(); +} diff --git a/src/app/marketing/_components/ContactsStep.tsx b/src/app/marketing/create/_components/ContactsStep.tsx similarity index 92% rename from src/app/marketing/_components/ContactsStep.tsx rename to src/app/marketing/create/_components/ContactsStep.tsx index bbad051..4f11b2e 100644 --- a/src/app/marketing/_components/ContactsStep.tsx +++ b/src/app/marketing/create/_components/ContactsStep.tsx @@ -90,3 +90,13 @@ const ContactsStep = () => { }; export default ContactsStep; + +ContactsStep.collectData = async () => { + const { getValues } = useContactsStepPresenter(); + return getValues(); +} + +ContactsStep.collectData = async () => { + const { getValues } = useContactsStepPresenter(); + return getValues(); +} diff --git a/src/app/marketing/_components/FeaturesStep.tsx b/src/app/marketing/create/_components/FeaturesStep.tsx similarity index 86% rename from src/app/marketing/_components/FeaturesStep.tsx rename to src/app/marketing/create/_components/FeaturesStep.tsx index 2b19e6e..7e592b6 100644 --- a/src/app/marketing/_components/FeaturesStep.tsx +++ b/src/app/marketing/create/_components/FeaturesStep.tsx @@ -33,3 +33,8 @@ const FeaturesStep = () => { }; export default FeaturesStep; + +FeaturesStep.collectData = async () => { + const { getValues } = useFeaturesStepPresenter(); + return getValues(); +} diff --git a/src/app/marketing/_components/FooterStep.tsx b/src/app/marketing/create/_components/FooterStep.tsx similarity index 93% rename from src/app/marketing/_components/FooterStep.tsx rename to src/app/marketing/create/_components/FooterStep.tsx index ffdd5b3..02733ca 100644 --- a/src/app/marketing/_components/FooterStep.tsx +++ b/src/app/marketing/create/_components/FooterStep.tsx @@ -69,4 +69,9 @@ const FooterStep = () => { ); }; -export default FooterStep; \ No newline at end of file +export default FooterStep; + +FooterStep.collectData = async () => { + const { getValues } = useFooterStepPresenter(); + return getValues(); +} \ No newline at end of file diff --git a/src/app/marketing/_components/HeroStep.tsx b/src/app/marketing/create/_components/HeroStep.tsx similarity index 97% rename from src/app/marketing/_components/HeroStep.tsx rename to src/app/marketing/create/_components/HeroStep.tsx index 6425656..4fb4c94 100644 --- a/src/app/marketing/_components/HeroStep.tsx +++ b/src/app/marketing/create/_components/HeroStep.tsx @@ -131,4 +131,9 @@ const HeroStep = () => { ); }; +HeroStep.collectData = async () => { + const { getValues } = useHeroStepPresenter(); + return getValues(); +} + export default HeroStep; diff --git a/src/app/marketing/_components/SectionStep.tsx b/src/app/marketing/create/_components/SectionStep.tsx similarity index 100% rename from src/app/marketing/_components/SectionStep.tsx rename to src/app/marketing/create/_components/SectionStep.tsx diff --git a/src/app/marketing/_components/useBenefitsStepPresenter.ts b/src/app/marketing/create/_components/useBenefitsStepPresenter.ts similarity index 100% rename from src/app/marketing/_components/useBenefitsStepPresenter.ts rename to src/app/marketing/create/_components/useBenefitsStepPresenter.ts diff --git a/src/app/marketing/_components/useChallengesStepPresenter.ts b/src/app/marketing/create/_components/useChallengesStepPresenter.ts similarity index 89% rename from src/app/marketing/_components/useChallengesStepPresenter.ts rename to src/app/marketing/create/_components/useChallengesStepPresenter.ts index 0a2785b..91576df 100644 --- a/src/app/marketing/_components/useChallengesStepPresenter.ts +++ b/src/app/marketing/create/_components/useChallengesStepPresenter.ts @@ -18,6 +18,7 @@ const useChallengesStepPresenter = () => { control, watch, formState: { errors }, + getValues } = useForm({ defaultValues: { challenges: [{ icon: "", title: "", description: "" }], @@ -33,6 +34,10 @@ const useChallengesStepPresenter = () => { console.log(data); }; + const collectData = async () => { + return getValues(); + }; + return { register, handleSubmit, @@ -43,7 +48,9 @@ const useChallengesStepPresenter = () => { remove, control, watch, - }; + getValues, + collectData + }; }; export default useChallengesStepPresenter; diff --git a/src/app/marketing/_components/useChartStepPresenter.ts b/src/app/marketing/create/_components/useChartStepPresenter.ts similarity index 87% rename from src/app/marketing/_components/useChartStepPresenter.ts rename to src/app/marketing/create/_components/useChartStepPresenter.ts index 8e2cf01..c533546 100644 --- a/src/app/marketing/_components/useChartStepPresenter.ts +++ b/src/app/marketing/create/_components/useChartStepPresenter.ts @@ -14,6 +14,7 @@ const useChartStepPresenter = () => { control, watch, formState: { errors }, + getValues } = useForm({ defaultValues: { chart_points: [{ x: "", y: 0 }], @@ -29,6 +30,10 @@ const useChartStepPresenter = () => { console.log(data); }; + const collectData = async () => { + return getValues(); + }; + return { register, handleSubmit, @@ -39,6 +44,8 @@ const useChartStepPresenter = () => { remove, control, watch, + getValues, + collectData }; }; diff --git a/src/app/marketing/_components/useContactsStepPresenter.ts b/src/app/marketing/create/_components/useContactsStepPresenter.ts similarity index 91% rename from src/app/marketing/_components/useContactsStepPresenter.ts rename to src/app/marketing/create/_components/useContactsStepPresenter.ts index b899130..297b3cd 100644 --- a/src/app/marketing/_components/useContactsStepPresenter.ts +++ b/src/app/marketing/create/_components/useContactsStepPresenter.ts @@ -18,6 +18,8 @@ const useContactsStepPresenter = () => { register, handleSubmit, control, + getValues, + formState: { errors }, } = useForm({ defaultValues: { @@ -49,6 +51,10 @@ const useContactsStepPresenter = () => { console.log(data); }; + const collectData = async () => { + return getValues(); + }; + return { register, handleSubmit, @@ -56,6 +62,8 @@ const useContactsStepPresenter = () => { onSubmit, fields, control, + collectData, + getValues, }; }; diff --git a/src/app/marketing/_components/useFeaturesStepPresenter.ts b/src/app/marketing/create/_components/useFeaturesStepPresenter.ts similarity index 88% rename from src/app/marketing/_components/useFeaturesStepPresenter.ts rename to src/app/marketing/create/_components/useFeaturesStepPresenter.ts index c6aa47f..1dcca68 100644 --- a/src/app/marketing/_components/useFeaturesStepPresenter.ts +++ b/src/app/marketing/create/_components/useFeaturesStepPresenter.ts @@ -18,6 +18,7 @@ const useFeaturesStepPresenter = () => { control, watch, formState: { errors }, + getValues } = useForm({ defaultValues: { features: [{ icon: "", title: "", description: "" }], @@ -33,6 +34,10 @@ const useFeaturesStepPresenter = () => { console.log(data); }; + const collectData = async () => { + return getValues(); + }; + return { register, handleSubmit, @@ -43,7 +48,9 @@ const useFeaturesStepPresenter = () => { remove, control, watch, - }; + getValues, + collectData + }; }; export default useFeaturesStepPresenter; diff --git a/src/app/marketing/_components/useFooterStepPresenter.ts b/src/app/marketing/create/_components/useFooterStepPresenter.ts similarity index 82% rename from src/app/marketing/_components/useFooterStepPresenter.ts rename to src/app/marketing/create/_components/useFooterStepPresenter.ts index 0e42083..30a9459 100644 --- a/src/app/marketing/_components/useFooterStepPresenter.ts +++ b/src/app/marketing/create/_components/useFooterStepPresenter.ts @@ -13,18 +13,25 @@ const useFooterStepPresenter = () => { register, handleSubmit, formState: { errors }, + getValues } = useForm(); const onSubmit = (data: FooterFormValues) => { console.log(data); }; + const collectData = async () => { + return getValues(); + }; + return { register, handleSubmit, onSubmit, errors, - }; + collectData, + getValues, + }; }; export default useFooterStepPresenter; \ No newline at end of file diff --git a/src/app/marketing/_components/useHeroStepPresenter.ts b/src/app/marketing/create/_components/useHeroStepPresenter.ts similarity index 76% rename from src/app/marketing/_components/useHeroStepPresenter.ts rename to src/app/marketing/create/_components/useHeroStepPresenter.ts index 4bd3934..5221b49 100644 --- a/src/app/marketing/_components/useHeroStepPresenter.ts +++ b/src/app/marketing/create/_components/useHeroStepPresenter.ts @@ -14,6 +14,7 @@ const useHeroStepPresenter = () => { register, handleSubmit, formState: { errors }, + getValues, } = useForm(); const onSubmit = (data: IHeroStepFields) => { @@ -25,7 +26,13 @@ const useHeroStepPresenter = () => { handleSubmit, errors, onSubmit, + getValues, }; }; +(useHeroStepPresenter as any).collectData = async () => { + const { getValues } = useForm(); + return getValues(); +}; + export default useHeroStepPresenter; diff --git a/src/app/marketing/create/page.tsx b/src/app/marketing/create/page.tsx new file mode 100644 index 0000000..079af26 --- /dev/null +++ b/src/app/marketing/create/page.tsx @@ -0,0 +1,112 @@ +"use client"; +import Breadcrumb from "@/components/Breadcrumbs/Breadcrumb"; +import { ShowcaseSection } from "@/components/Layouts/showcase-section"; +import Stepper, { Step } from "@/components/ui/Stepper"; +import { BreadcrumbItem } from "@/types/shared"; +import { useRef, useState } from "react"; +import ChallengesStep from "./_components/ChallengesStep"; +import ChartStep from "./_components/ChartStep"; +import ContactsStep from "./_components/ContactsStep"; +import FeaturesStep from "./_components/FeaturesStep"; +import FooterStep from "./_components/FooterStep"; +import HeroStep from "./_components/HeroStep"; + +const Marketing = () => { + const [step, setStep] = useState(0); + const heroRef = useRef(null); + const chartRef = useRef(null); + const featuresRef = useRef(null); + const challengesRef = useRef(null); + const benefitsRef = useRef(null); + const contactsRef = useRef(null); + const footerRef = useRef(null); + const breadcrumbItems: BreadcrumbItem[] = [ + { + href: "/", + name: "Dashboard", + }, + { + href: "/marketing", + name: "Marketing", + }, + { + href: "/marketing/create", + name: "Create Marketing", + }, + ]; + + const collectStepData = async (stepIndex: number) => { + let stepData = {}; + const refs = [heroRef, chartRef, featuresRef, challengesRef, benefitsRef, contactsRef, footerRef]; + + const currentRef = refs[stepIndex]; + if (currentRef?.current?.collectData) { + stepData = await currentRef.current.collectData(); + + // Submit data to backend + if (stepData) { + await submitData(stepData, stepIndex); + } + } + }; + + const submitData = async (data: any, stepIndex: number) => { + const apiUrl = "/api/marketing-data"; + console.log(`Submitting data for step ${stepIndex}:`, data); + }; + + const steps: Step[] = [ + { + title: "Hero", + description: "Create the hero section", + content: , + }, + { + title: "Chart", + description: "Create the chart", + content: , + }, + { + title: "Features", + description: "Add features", + content: , + }, + { + title: "Challenges", + description: "Create challenges section", + content: , + }, + { + title: "Benefits", + description: "create benefits section", + content: , + }, + { + title: "Contacts", + description: "Create contacts section", + content: , + }, + { + title: "Footer", + description: "Add footer information", + content: , + }, + ]; + return ( + <> + + + { + collectStepData(step); + setStep(newStep); + }} + > + + + ); +}; + +export default Marketing; diff --git a/src/app/marketing/page.tsx b/src/app/marketing/page.tsx index 183e9e4..4515afe 100644 --- a/src/app/marketing/page.tsx +++ b/src/app/marketing/page.tsx @@ -1,18 +1,8 @@ -"use client"; import Breadcrumb from "@/components/Breadcrumbs/Breadcrumb"; -import Stepper, { Step } from "@/components/ui/Stepper"; +import CmsTable from "@/components/Tables/cms"; import { BreadcrumbItem } from "@/types/shared"; -import { useState } from "react"; -import { ShowcaseSection } from "../../components/Layouts/showcase-section"; -import ChallengesStep from "./_components/ChallengesStep"; -import ChartStep from "./_components/ChartStep"; -import ContactsStep from "./_components/ContactsStep"; -import FeaturesStep from "./_components/FeaturesStep"; -import FooterStep from "./_components/FooterStep"; -import HeroStep from "./_components/HeroStep"; -const Marketing = () => { - const [step, setStep] = useState(5); +const MarketingPage = () => { const breadcrumbItems: BreadcrumbItem[] = [ { href: "/", @@ -23,55 +13,12 @@ const Marketing = () => { name: "Marketing", }, ]; - const steps: Step[] = [ - { - title: "Hero", - description: "Create the hero section", - content: , - }, - { - title: "Chart", - description: "Create the chart", - content: , - }, - { - title: "Features", - description: "Add features", - content: , - }, - { - title: "Challenges", - description: "Create challenges section", - content: , - }, - { - title: "Benefits", - description: "create benefits section", - content: , - }, - { - title: "Contacts", - description: "Create contacts section", - content: , - }, - { - title: "Footer", - description: "Add footer information", - content: , - }, - ]; return ( <> - - - + ); }; -export default Marketing; +export default MarketingPage; diff --git a/src/components/Auth/Signin/index.tsx b/src/components/Auth/Signin/index.tsx index 00e75f3..f289398 100644 --- a/src/components/Auth/Signin/index.tsx +++ b/src/components/Auth/Signin/index.tsx @@ -1,5 +1,3 @@ -import Link from "next/link"; -import GoogleSigninButton from "../GoogleSigninButton"; import SigninWithPassword from "../SigninWithPassword"; export default function Signin() { diff --git a/src/components/HOC/EmptyListWrapper.tsx b/src/components/HOC/EmptyListWrapper.tsx new file mode 100644 index 0000000..76e421f --- /dev/null +++ b/src/components/HOC/EmptyListWrapper.tsx @@ -0,0 +1,30 @@ +import { TableCell, TableRow } from "@/components/ui/table"; +import { ReactNode } from "react"; + +interface EmptyListWrapperProps { + list: T[]; + emptyMessage: string; + columns: string[]; + children: ReactNode; +} + +function EmptyListWrapper({ + list, + emptyMessage, + columns, + children, +}: EmptyListWrapperProps) { + if (!list.length) { + return ( + + +

{emptyMessage}

+
+
+ ); + } + + return <>{children}; +} + +export default EmptyListWrapper; diff --git a/src/components/Tables/cms/index.tsx b/src/components/Tables/cms/index.tsx new file mode 100644 index 0000000..f8d64ed --- /dev/null +++ b/src/components/Tables/cms/index.tsx @@ -0,0 +1,39 @@ +"use client"; +import EmptyListWrapper from "@/components/HOC/EmptyListWrapper"; +import ListHeader from "@/components/ui/ListHeader"; +import { Table, TableBody, TableHead } from "@/components/ui/table"; +import TableSkeleton from "@/components/ui/TableSkeleton"; +import { TableHeader, TableRow } from "../../ui/table"; +import useCmsTablePresenter from "./useCmsTablePresenter"; + +const CmsTable = () => { + const { columns, data, isPending } = useCmsTablePresenter(); + return ( +
+ + + + + {columns.map((column) => ( + + {column} + + ))} + + + {isPending && } + + + Hollo + + +
+
+ ); +}; + +export default CmsTable; diff --git a/src/components/Tables/cms/useCmsTablePresenter.ts b/src/components/Tables/cms/useCmsTablePresenter.ts new file mode 100644 index 0000000..faaa018 --- /dev/null +++ b/src/components/Tables/cms/useCmsTablePresenter.ts @@ -0,0 +1,15 @@ +"use client"; +import { useGetCmsList } from "@/hooks/queries/useCmsQueries"; + +const useCmsTablePresenter = () => { + const columns = ["row", "title", "created at"]; + const { isPending, data } = useGetCmsList(); + + return { + columns, + isPending, + data, + }; +}; + +export default useCmsTablePresenter; diff --git a/src/hooks/queries/useCmsQueries.ts b/src/hooks/queries/useCmsQueries.ts new file mode 100644 index 0000000..c9fcb6c --- /dev/null +++ b/src/hooks/queries/useCmsQueries.ts @@ -0,0 +1,22 @@ +import { API_ENDPOINTS } from "@/lib/api"; +import { cmsService } from "@/lib/api/services/cms-service"; +import { useMutation, useQuery } from "@tanstack/react-query"; +import { useMemo } from "react"; + +export const useGetCmsList = () => { + const queryKey = useMemo(() => [API_ENDPOINTS.CMS.BASE()], []); + return useQuery({ + queryKey, + queryFn: cmsService.getCms, + }); +}; +export const useCreateCms = () => { + const mutationKey = useMemo( + () => [API_ENDPOINTS.CMS.BASE(), "Create cms"], + [], + ); + return useMutation({ + mutationKey, + mutationFn: cmsService.createCms, + }); +}; diff --git a/src/lib/api/endpoints.ts b/src/lib/api/endpoints.ts index 3e90ec3..790d215 100644 --- a/src/lib/api/endpoints.ts +++ b/src/lib/api/endpoints.ts @@ -3,6 +3,9 @@ export const API_ENDPOINTS = { POSTS: { READ_ALL: "posts ", }, + CMS: { + BASE: (id?: string) => (id ? `cms/${id}` : "cms"), + }, USER: { LOGIN: "profile/login", LOGOUT: "profile/logout", diff --git a/src/lib/api/services/cms-service.ts b/src/lib/api/services/cms-service.ts new file mode 100644 index 0000000..233074b --- /dev/null +++ b/src/lib/api/services/cms-service.ts @@ -0,0 +1,23 @@ +import api from "../axios"; +import { API_ENDPOINTS } from "../endpoints"; +import { ApiResponse } from "../types"; +import { TCmsResponse } from "../types/TCms"; + +export const cmsService = { + getCms: async (): Promise> => { + try { + return (await api.get(API_ENDPOINTS.CMS.BASE())).data; + } catch (error) { + console.error("Error Caught in CMS Service => Get cms", error); + throw error; + } + }, + createCms: async (data: any) => { + try { + return (await api.post(API_ENDPOINTS.CMS.BASE(), data)).data; + } catch (error) { + console.error("Error Caught in CMS Service => Create cms", error); + throw error; + } + }, +}; diff --git a/src/lib/api/types/TCms.ts b/src/lib/api/types/TCms.ts new file mode 100644 index 0000000..9a52f47 --- /dev/null +++ b/src/lib/api/types/TCms.ts @@ -0,0 +1,84 @@ +import { z } from "zod"; + +const CmsSchema = z.object({ + cms: z.array( + z.object({ + advantages: z.object({ + cards: z.array( + z.object({ + description: z.string(), + icon: z.string(), + title: z.string(), + }), + ), + description: z.string(), + title: z.string(), + }), + challenges: z.object({ + cards: z.array( + z.object({ + description: z.string(), + icon: z.string(), + title: z.string(), + }), + ), + description: z.string(), + title: z.string(), + }), + chart: z.object({ + data: z.array( + z.object({ + key: z.string(), + value: z.number(), + }), + ), + missedAmount: z.string(), + title: z.string(), + }), + contact: z.object({ + description: z.string(), + fields: z.array( + z.object({ + label: z.string(), + name: z.string(), + placeholder: z.string(), + required: z.boolean(), + }), + ), + submitButtonText: z.string(), + title: z.string(), + }), + features: z.object({ + cards: z.array( + z.object({ + description: z.string(), + icon: z.string(), + title: z.string(), + }), + ), + description: z.string(), + title: z.string(), + }), + footer: z.object({ + copyright: z.string(), + email: z.string(), + location: z.string(), + phone: z.string(), + tagline: z.string(), + }), + hero: z.object({ + buttonLink: z.string(), + buttonText: z.string(), + description: z.string(), + gifFile: z.string(), + title: z.string(), + }), + created_at: z.number(), + updated_at: z.number(), + id: z.string(), + key: z.string(), + type: z.string(), + }), + ), +}); +export type TCmsResponse = z.infer;