// @flow
import React from 'react';
import { action } from '@storybook/addon-actions';
import { storiesOf } from '@storybook/react';
import { withDocs } from '../../../../.storybook/with-docs';
import { SecondaryButton } from '.';
import docs from './SECONDARY_BUTTON.mkd';

storiesOf('Core/Actions/Button/secondary', module)
  .add(
    'button',
    withDocs(docs)(() => (
      <>
        <SecondaryButton onClick={action('clicked')} spacing="mr1">
          Click me
        </SecondaryButton>
        <SecondaryButton onClick={action('clicked')} disabled>
          Disabled
        </SecondaryButton>
      </>
    )),
  )
  .add(
    'link button',
    withDocs(docs)(() => (
      <>
        <SecondaryButton href="https://google.com" spacing="mr1">
          {'<a />'} element
        </SecondaryButton>
        <SecondaryButton onClick={action('clicked')}>
          {'<button />'} element
        </SecondaryButton>
      </>
    )),
  );
