import projectTeaserHorizontalTwig from './node.project.teaser-horizontal.twig';
import projectTeaserHorizontalData from './node.project.teaser-horizontal.yml';
import './node.project.teaser-horizontal.js';

import imgTwig from '@ui-base/img/_img.twig';
import {formatParagraphText} from '.storybook/utils';

/**
 * Storybook Definition.
 */
export default {
  title: 'Content Types/Project/Teaser Horizontal',
};

export const teaserHorizontal = (args) => {
  // Create deep copy of data and merge args.
  let data = JSON.parse(JSON.stringify(projectTeaserHorizontalData ?? {}));
  data = Object.assign(data, args);

  return projectTeaserHorizontalTwig({
    ...data,
    node_teaser_field_erm_page_image: imgTwig({ image_src: data.node_teaser_field_erm_page_image }),
    node_teader_field_summary: formatParagraphText(data.node_teader_field_summary)
  });
}
teaserHorizontal.args = projectTeaserHorizontalData;
