// @flow
import React from 'react';
import { CurrencyFormatter } from './index';
import docs from './currency-formatter.mdx';

export default {
  component: CurrencyFormatter,
  title: 'Primitives/CurrencyFormatter',
  parameters: {
    docs: {
      page: docs,
    },
  },
};

export const Normal = () => (
  <CurrencyFormatter value={2489500.92} currency="CAD" />
);

export const RoundToWhole = () => (
  <CurrencyFormatter
    value={2489500.92}
    currency="CAD"
    minimumFractionDigits={0}
    maximumFractionDigits={0}
  />
);

export const PlusSignIfPositive = () => (
  <CurrencyFormatter
    value={2489500.92}
    currency="CAD"
    minimumFractionDigits={0}
    maximumFractionDigits={0}
    showPlusSign
  />
);

export const PlusSignButValueIsNegative = () => (
  <CurrencyFormatter
    value={-2489500.92}
    currency="CAD"
    minimumFractionDigits={0}
    maximumFractionDigits={0}
    showPlusSign
  />
);
