import JsonToHtml from "@/components/JsonToHtml"
import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"

import styles from "./textcols.module.css"

import type { 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>
  )
}
