import React from 'react';
import { storiesOf } from '@storybook/react';
import { boolean, select } from '@storybook/addon-knobs';
import { asyncStates } from '../../../storybook/utils';

import { LineLoader } from '../index';

const props = ({
  isPageLoader = undefined,
  isDisplayOnLoaded = undefined,
  asyncStatus = undefined,
  asyncStatusList = undefined,
  asyncStatusBusyList = undefined,
} = {}) => ({
  isPageLoader: boolean('is page loader', isPageLoader),
  isDisplayOnLoaded: boolean('is display on loaded', isDisplayOnLoaded),
  asyncStatus: select('async status', asyncStates({ isList: false }), asyncStatus),
  asyncStatusList: select('async status list', asyncStates({ isList: true }), asyncStatusList),
  asyncStatusBusyList: select('async status busy list', asyncStates({ isList: true }), asyncStatusBusyList),
});


storiesOf('Web|Loader/LineLoader', module)
  .add('default', () => (
    <LineLoader {...props()} />
  ))
