import { RTETypeEnum } from "@scandic-hotels/trpc/types/RTEenums"

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

import type { EmbedByUid } from "@/types/components/deprecatedjsontohtml"
import type { RTEDefaultNode, RTENext } from "@/types/rte/node"
import type { RenderOptions } from "@/types/rte/option"

export const renderOptions: RenderOptions = {
  [RTETypeEnum.p]: (
    node: RTEDefaultNode,
    embeds: EmbedByUid,
    next: RTENext,
    fullRenderOptions: RenderOptions
  ) => {
    return (
      <p key={node.uid} className={styles.p}>
        {next(node.children, embeds, fullRenderOptions)}
      </p>
    )
  },
}
