// @flow
import React from 'react';
import { storiesOf } from '@storybook/react';
import { withInfo } from '@storybook/addon-info';
import { PercentFormatter } from './index';
import { configDocs } from '../../../.storybook/config-docs';
import docs from './PERCENT-FORMATTER.mkd';

storiesOf('Primitives/PercentFormatter', module)
  .addDecorator(withInfo(configDocs(docs, PercentFormatter)))
  .add('normal', () => <PercentFormatter value={0.4161} />)
  .add('round to whole', () => (
    <PercentFormatter
      value={0.4161}
      minimumFractionDigits={0}
      maximumFractionDigits={0}
    />
  ));
