import type { Meta, StoryObj } from '@storybook/react-vite' import React, { useCallback } from 'react' import ScrollingContainer from '../ScrollingContainer/ScrollingContainer' import { SelectDisplayRow } from '../Selects/SelectDisplay/SelectDisplay' import { capitalize } from '../../services/HelperServiceTyped' import DraggableListComponent from '../DragAndDrop/DraggableList' import DragHandle from '../DragHandle/DragHandle' import { DocsTemplate } from '../../../.storybook' const meta: Meta = { title: 'Components/DraggableList', component: DraggableListComponent, parameters: { docs: { page: () => ( The DraggableList component enables users to reorder items in a list through drag and drop interactions. It provides a flexible container for creating sortable lists with customizable item rendering and drag handles. } /> ), }, }, } export default meta type Story = StoryObj const DraggableList = () => { const listItems = Array.from({ length: 100 }, (_, i) => `Item ${i + 1}`) const [items, setItems] = React.useState(listItems) const callout = useCallback((newList) => { setItems(newList) }, []) return (
{listItems.map((item, index) => (
null} />
))}
) } const Template: Story = { render: () => , } export const Basic: Story = { ...Template, }