import type { Meta, StoryObj } from '@storybook/react'; import React, { useState } from 'react'; import { within, userEvent } from 'storybook/test'; import { Button } from '../../Button'; import { ModalSlideshow } from '../ModalSlideshow'; const slides = [ { title: 'Check request details', content: (

You will have the request details needed for approval. Once approved, the requester will be notified and can generate a dedicated virtual card for the purchase.

), illustration: ( ), }, { title: 'What is a valid receipt', content: ( <>

A receipt or a proof of purchase is a document provided by the merchant as record of your purchase of goods or services. A valid receipt must contain the following info:

  1. The date of purchase
  2. The name and address of the supplier
  3. A description of the items purchased, including individual prices and quantities
  4. The VAT if applicable
  5. The total price
), illustration: ( ), }, { title: 'Four ways to upload', content: ( <>

This is where the description of the slide goes. The goal is to explain your message as succinctly as possible. And preferably in three lines if you use this variant.

1. With the Spendesk mobile app

Download the mobile app to your phone and snap a picture of your receipt directly into your account.

2. On the Spendesk website

Drag and drop your receipt to the related payment from your desktop.

3. By email reply

Replay to the payment confirmation email with your email attached.

4. By email forward

Forward your receipt to receipts+[yourcompanyid]@spendesk.com. List content 5 Description of content

), illustration: ( ), }, ]; const meta: Meta = { title: 'Feedback/ModalSlideshow', component: ModalSlideshow, args: { slides, translations: { cancel: 'Cancel', previous: 'Back', next: 'Next', done: 'Action wording', }, }, play: async ({ canvasElement }) => { const canvas = within(canvasElement); const openButton = canvas.getByRole('button', { name: 'Open the modal', }); await userEvent.click(openButton); }, parameters: { chromatic: { delay: 300, disableSnapshot: false }, }, }; export default meta; type Story = StoryObj; export const Default: Story = { render: (args) => { const portalContainer = document.getElementById('storybook-root'); const [isOpen, setIsOpen] = useState(false); return ( <>