import documentListTwig from './paragraph.document-list.twig';
import documentListData from './paragraph.document-list.yml';
import './paragraph.document-list.js';

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

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

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

  data.paragraph = setPublishedStatus(data.paragraph_is_published);

  return documentListTwig({
    ...data,
  });
}

documentList.args = documentListData;
