import { configure, getStorybook } from '@storybook/react';
import { addParameters } from '@storybook/react';
import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport';
import { addDecorator } from '@storybook/react';
import { withConsole } from '@storybook/addon-console';

addParameters({
  info: { inline: true },
  viewport: {
    viewports: INITIAL_VIEWPORTS,
    defaultViewport: 'someDefault',
  },
});
// automatically import all files ending in *.stories.tsx
configure(
  require.context('../stories', true, /\.stories\.tsx?$/), module
)

addDecorator((storyFn, context) => withConsole()(storyFn)(context));

export { getStorybook }