import React, { useState } from 'react'; import { Meta, Story } from '@storybook/react'; import SlidePanel, { ISlidePanelSlideProps } from './SlidePanel'; import Button from '../Button/Button'; import AnalyzeDataIcon from '../Icon/AnalyzeDataIcon/AnalyzeDataIcon'; import CalendarIcon from '../Icon/CalendarIcon/CalendarIcon'; import DuplicateIcon from '../Icon/DuplicateIcon/DuplicateIcon'; import EditIcon from '../Icon/EditIcon/EditIcon'; import FileIcon from '../Icon/FileIcon/FileIcon'; import ImageIcon from '../Icon/ImageIcon/ImageIcon'; import SettingsIcon from '../Icon/SettingsIcon/SettingsIcon'; export default { title: 'Private/SlidePanel', component: SlidePanel, parameters: { docs: { description: { component: SlidePanel.peek.description, }, }, }, args: SlidePanel.defaultProps, } as Meta; /* Looped Slides */ export const LoopedSlides: Story = (args) => { const Slide = SlidePanel.Slide; const [offset, setOffset] = useState(0); const handlePrev = () => { setOffset(offset - 1); }; const handleNext = () => { setOffset(offset + 1); }; const handleSwipe = (slidesSwiped: any) => { setOffset(offset + slidesSwiped); }; return (
Current offset: {offset}
); };