feat(SW-213): Created Text Cols component and added to Blocks in Contentstack
This commit is contained in:
26
components/Content/Blocks/TextCols/index.tsx
Normal file
26
components/Content/Blocks/TextCols/index.tsx
Normal file
@@ -0,0 +1,26 @@
|
||||
import JsonToHtml from "@/components/JsonToHtml"
|
||||
import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
|
||||
|
||||
import styles from "./textcols.module.css"
|
||||
|
||||
import { TextColsProps } from "@/types/components/content/blocks"
|
||||
|
||||
export default function TextCols({ text_cols }: TextColsProps) {
|
||||
return (
|
||||
<div className={styles.columns}>
|
||||
{text_cols.columns.map((col) => {
|
||||
return (
|
||||
<div key={col.title} className={styles.column}>
|
||||
<Subtitle>{col.title}</Subtitle>
|
||||
<div className={styles.text}>
|
||||
<JsonToHtml
|
||||
nodes={col.text.json.children}
|
||||
embeds={col.text.embedded_itemsConnection.edges}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user