import { Story, Canvas, ArgsTable, Meta } from '@storybook/addon-docs/blocks';
import BundleCard from '../BundleCard';
import { getBundlePricing } from '../../../components/product-bundles/ProductBundles';
import { productBundleMock } from '../../../../mocks/product/productBundles';
import { CollapsibleJsonSnippet } from '../../../tools/docTools';

export const bundle = productBundleMock.bundle.items[0];

export const bundleDataMock = {
    ...bundle,
    pricing: getBundlePricing(bundle.edition, productBundleMock.bundle.pricing.editions)
};

<Meta title="Atoms/Bundle Card" component={BundleCard} />

# BundleCard
<br />

## `BundleCards` are used to display a product bundle card description.
<br />

### Default
<Canvas>
    <Story name="Default">
        <BundleCard data={bundle} />
    </Story>
</Canvas>

### With pricing
<Canvas>
    <Story name="With pricing">
        <BundleCard data={bundleDataMock} />
    </Story>
</Canvas>

## Usage Example
<CollapsibleJsonSnippet
    summary="dataObj"
    code={bundleDataMock}
/>

```jsx
import BundleCard from '@appdirect/sfb-theme-components/src/atoms/bundle-card/BundleCard';

<BundleCard data={dataObj} />
```
## Props
<ArgsTable of={BundleCard} />
