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';
import bilingoTheme from './bilingoTheme';

import 'antd/dist/antd.less';

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

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

export { getStorybook }