// @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 { MarginChecker } from '../../../mixins/spacing/story-support/margin-checker';
import { PaddingChecker } from '../../../mixins/spacing/story-support/padding-checker';
import { StackeeChecker } from '../../../mixins/stackee/story-support/stackee-checker';
import docs from './secondary-button.mdx';

export default {
  component: SecondaryButton,
  title: 'Buttons/Secondary',
  parameters: {
    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>
);

export const MixinsSpacing = () => (
  <>
    <MarginChecker Component={SecondaryButton} {...DEFAULT_PROPS_CLICK}>
      Click me
    </MarginChecker>
    <PaddingChecker Component={SecondaryButton} {...DEFAULT_PROPS_CLICK}>
      Click me
    </PaddingChecker>
  </>
);

export const MixinsStackee = () => (
  <StackeeChecker Component={SecondaryButton} {...DEFAULT_PROPS_CLICK}>
    Click me
  </StackeeChecker>
);
