// @flow
import React from 'react';
import { action } from '@storybook/addon-actions';
import { SecondaryButton } from './secondary-button.component';
import type { SecondaryButtonProps } from './secondary-button.proptypes';
import docs from './secondary-button.mdx';

export default {
  component: SecondaryButton,
  title: 'Buttons/Secondary',
  parameters: {
    fileName: __filename,
    docs: {
      page: docs,
    },
  },
};

const DEFAULT_PROPS_CLICK: SecondaryButtonProps = {
  onClick: action('clicked'),
};

const DEFAULT_PROPS_HREF: SecondaryButtonProps = {
  href: 'https://google.com',
};

export const Default = () => (
  <SecondaryButton {...DEFAULT_PROPS_CLICK}>Button Action</SecondaryButton>
);

export const Disabled = () => (
  <SecondaryButton {...DEFAULT_PROPS_CLICK} disabled>
    Button Action
  </SecondaryButton>
);

export const AsLink = () => (
  <SecondaryButton {...DEFAULT_PROPS_HREF}>Button Link</SecondaryButton>
);
