import styles from "./html.module.scss"
import classNames from 'classnames'
import { SerializedEditorState, SerializedLexicalNode } from 'lexical'
import { RichText } from './RichText'

type HTMLTextProps = {
  width: "1/2" | "3/4",
  data: SerializedEditorState<SerializedLexicalNode>
}

export const HTMLText = ({width, data}: HTMLTextProps) => {
  return (
    <div className={classNames({
      [styles.half]: width === "1/2",
      [styles.threeFourth]: width === "3/4"
    })}>
      <RichText data={data} />
    </div>
  )
}