diff --git a/components/Blocks/Accordion/index.tsx b/components/Blocks/Accordion/index.tsx index 6d1afbd22..f1343a237 100644 --- a/components/Blocks/Accordion/index.tsx +++ b/components/Blocks/Accordion/index.tsx @@ -11,7 +11,7 @@ import { ShowMoreButton } from "../../ContentType/HotelPage/ShowMoreButton" import styles from "./accordion.module.css" -import type { AccordionProps } from "../../../types/components/hotelPage/accordion" +import type { AccordionProps } from "@/types/components/blocks/Accordion" export default function AccordionSection({ accordion, title }: AccordionProps) { const [allItemsVisible, setAllItemsVisible] = useState(false) diff --git a/components/Blocks/index.tsx b/components/Blocks/index.tsx index 1f710343d..43843ee30 100644 --- a/components/Blocks/index.tsx +++ b/components/Blocks/index.tsx @@ -15,6 +15,14 @@ export default function Blocks({ blocks }: BlocksProps) { return blocks.map((block, idx) => { const firstItem = idx === 0 switch (block.typename) { + case BlocksEnums.block.Accordion: + return ( + + ) case BlocksEnums.block.CardsGrid: return ( - case BlocksEnums.block.Accordion: - return ( - - ) + default: return null } diff --git a/server/routers/contentstack/schemas/blocks/accordion.ts b/server/routers/contentstack/schemas/blocks/accordion.ts index d96c2b7f7..f6a5a386a 100644 --- a/server/routers/contentstack/schemas/blocks/accordion.ts +++ b/server/routers/contentstack/schemas/blocks/accordion.ts @@ -33,7 +33,7 @@ export const accordionItemsSchema = z.array( }) ) -export type Accordion = z.infer // MOVE +export type Accordion = z.infer enum AccordionEnum { ContentPageBlocksAccordionBlockFaqGlobalFaq = "ContentPageBlocksAccordionBlockFaqGlobalFaq", diff --git a/types/components/hotelPage/accordion.ts b/types/components/blocks/Accordion.ts similarity index 51% rename from types/components/hotelPage/accordion.ts rename to types/components/blocks/Accordion.ts index 69325ae40..3beb86c1f 100644 --- a/types/components/hotelPage/accordion.ts +++ b/types/components/blocks/Accordion.ts @@ -1,4 +1,4 @@ -import type { Accordion } from "@/server/routers/contentstack/schemas/blocks/accordion" +import { Accordion } from "@/server/routers/contentstack/schemas/blocks/accordion" export type AccordionProps = { accordion: Accordion["accordion"]["faq"]