import '../gatsby-browser';
import React from 'react';

global.___loader = {
  enqueue: () => {},
  hovering: () => {},
};

global.__PATH_PREFIX__ = '';
global.__BASE_PATH__ = '';

window.___navigate = (pathname) => {
  action('NavigateTo:')(pathname);
};

export const parameters = {
  controls: { expanded: true },
  actions: { argTypesRegex: '^on[A-Z].*' },
  options: {
    storySort: {
      // method: 'alphabetical',
      method: 'configure',
      includeNames: true,
      order: [
        'Theme',
        [
          'Layout',
          ['Navigation', 'Footer', 'Footer Navigation'],
          'Modules',
          [
            'Content',
            [
              'Common',
              ['Text and Images', ['Text', 'Show More Text', '*'], '*'],
              'Template One',
              'Template Two',
              'Template Three',
            ],
            'Spotlight',
            ['Icon', 'Image', 'Image Text', ['Template One', 'Template Two', 'Template Three']],
          ],
          'Atoms',
          'Molecules',
          ['Bonus box', ['Template One', 'Template Two', 'Template Three', 'Template Four']],
          'Organisms',
          'Pages',
          'Hooks',
        ],
      ],
    },
  },
};

// Global decorators for stories
export const decorators = [
  (Story) => (
    <div>
      <Story />
    </div>
  ),
];
