import { IGenericSection } from '../../../generic/types';
import { IOutputHtml } from '../../types';
import { transformText } from './text';
// import { toMarkdown } from '../../../../helpers/html-to-md';

export const transformOutputHtml = (msg: IOutputHtml): IGenericSection => {
  // const mdText: string = toMarkdown(msg.value);
  const text = transformText(msg.value);
  if (text && text.props) {
    text.props.type = 'html';
  }
  const result: IGenericSection = {
    type: 'section',
    children: [text]
  };

  return result;
};