import type { Meta, StoryObj } from '@storybook/react'; import { ImageViewerModal } from './ImageViewerModal'; import { Button } from './button'; import { useState } from 'react'; const meta = { title: 'UI/ImageViewerModal', component: ImageViewerModal, tags: ['autodocs'], } satisfies Meta; export default meta; type Story = StoryObj; export const Default: Story = { render: () => { const [open, setOpen] = useState(false); const image = "https://images.unsplash.com/photo-1682687220742-aba13b6e50ba"; return ( <> {open && ( setOpen(false)} /> )} ); }, }; export const Gallery: Story = { render: () => { const [open, setOpen] = useState(false); const [index, setIndex] = useState(0); const images = [ "https://images.unsplash.com/photo-1682687220742-aba13b6e50ba", "https://images.unsplash.com/photo-1682687220063-4742bd7fd538", "https://images.unsplash.com/photo-1682687220199-d0124f48f95b" ]; return ( <> {open && ( setOpen(false)} hasNext={index < images.length - 1} hasPrev={index > 0} onNext={() => setIndex(i => i + 1)} onPrev={() => setIndex(i => i - 1)} /> )} ); }, };