import impactTitleTwig from './paragraph.impact-title.twig';
import impactTitleData from './paragraph.impact-title.yml';
import './paragraph.impact-title.js';

import { setPublishedStatus } from '.storybook/utils';

/**
 * Storybook Definition.
 */
export default {
  title: 'Layout Components/Impact Title',
};

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

  data.paragraph = setPublishedStatus(data.paragraph_is_published);

  return impactTitleTwig({
    ...data,
  });
}
impactTitle.args = impactTitleData;
