// @flow
import React from 'react';
import { action } from '@storybook/addon-actions';
import { TertiaryButton } from './tertiary-button.component';
import type { TertiaryButtonProps } from './tertiary-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 './tertiary-button.mdx';

export default {
  component: TertiaryButton,
  title: 'Buttons/Tertiary',
  parameters: {
    docs: {
      page: docs,
    },
  },
};

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

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

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

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

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

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

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