import { Meta, Story, ArgsTable, Canvas } from '@storybook/blocks';
import { getArgs } from '../../../tools/controlsHelper';
import { TableContentFromObject, FormOutput, CollapsibleJsonSnippet } from '../../../tools/docTools';
import { ProductSimilarAppsComponent as ProductSimilarApps } from '../ProductSimilarApps';
import { productSimilarAppsMock } from '../../../../mocks/components/productSimilarApps';
import * as ProductSimilarAppsStories from './ProductSimilarApps.stories';

export const productSimilarAppsSettings = {
    sliderTitle: 'The title of the slider.',
    layout: 'The style of the slider\'s tiles.',
    size: 'The size of the slider\'s tiles (small, medium, large).',
    tileBackgroundColor: 'The background color of the slider\'s tiles.',
    tileCtaLabel: 'The text for the cta at the bottom of the tile when the layout is set to TALL.',
    displayOptions: 'Show/hide the slider\'s tiles description or ratings.',
    borderRadius: 'The border radius of the slider\'s tiles.',
    quickviewOptions: 'Show/hide the slider\'s tiles quickview.',
    sortBy: 'The ordering of the slider (alphabetical, random).'
};

<Meta of={ProductSimilarAppsStories} />

# ProductSimilarApps

<br />

## `ProductSimilarApps` are used to display recommended apps in a slider.

<br />

### Default

<Canvas>
  <Story of={ProductSimilarAppsStories.Default} />
</Canvas>

### With settings

<Canvas>
  <Story of={ProductSimilarAppsStories.WithSettings} />
</Canvas>

## Usage Example

<CollapsibleJsonSnippet summary="productSimilarAppsData" code={productSimilarAppsMock} />

<br />

<CollapsibleJsonSnippet summary="productSimilarAppsSettings" code={getArgs(ProductSimilarApps.schema().form)} />

```jsx
import ProductSimilarApps from
    '@appdirect/sfb-theme-components/src/components/product-similar-apps/ProductSimilarApps';

<ProductSimilarApps data={productSimilarAppsData} settings={productSimilarAppsSettings} />
```

## Props

<ArgsTable of={ProductSimilarApps} />

## Schema

### Form Settings

<table>
  <TableContentFromObject obj={productSimilarAppsSettings} />
</table>

### Form Output

<FormOutput code={ProductSimilarApps.schema().form} />
