"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = createHtmlTextAtom;

var _handlebars = _interopRequireDefault(require("handlebars"));

var _utils = require("../utils");

var _templates = require("../templates");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/**
 * Create HTML content for TextAtom
 * @param {object} atom atom json
 * @param {string} outputPath path to save the assets
 * @returns {string} HTML content
 */
async function createHtmlTextAtom(atom, outputPath) {
  const text = await (0, _utils.createHtmlText)(atom.text, outputPath, atom.id);
  const html = await (0, _templates.loadTemplate)('atom.text');
  const data = {
    text
  };

  const template = _handlebars.default.compile(html);

  return template(data);
}