|
| 1 | +import type { Meta, StoryObj } from '@storybook/nextjs-vite'; |
| 2 | +import { useState } from 'react'; |
| 3 | + |
| 4 | +import GroupList from './GroupList'; |
| 5 | + |
| 6 | +const meta = { |
| 7 | + title: 'Features/Groups/GroupList', |
| 8 | + component: GroupList, |
| 9 | + parameters: { |
| 10 | + layout: 'fullscreen', |
| 11 | + viewport: { |
| 12 | + defaultViewport: 'mobile1', |
| 13 | + }, |
| 14 | + }, |
| 15 | + tags: ['autodocs'], |
| 16 | +} satisfies Meta<typeof GroupList>; |
| 17 | + |
| 18 | +export default meta; |
| 19 | + |
| 20 | +type Story = StoryObj<typeof meta>; |
| 21 | + |
| 22 | +const groups = [ |
| 23 | + { id: 1, name: '친구 많은 모임', type: 'friend' as const, image: '' }, |
| 24 | + { id: 2, name: '어떤 모임', type: 'friend' as const, image: '' }, |
| 25 | + { id: 3, name: '친구 모임', type: 'friend' as const, image: '' }, |
| 26 | + { id: 4, name: '어떤 모임', type: 'friend' as const, image: '' }, |
| 27 | + { id: 5, name: '친구 모임', type: 'friend' as const, image: '' }, |
| 28 | + { id: 6, name: '어떤 모임', type: 'friend' as const, image: '' }, |
| 29 | + { id: 7, name: '친구 모임', type: 'friend' as const, image: '' }, |
| 30 | + { id: 8, name: '어떤 모임', type: 'friend' as const, image: '' }, |
| 31 | + { id: 9, name: '친구 모임', type: 'friend' as const, image: '' }, |
| 32 | + { id: 10, name: '어떤 모임', type: 'friend' as const, image: '' }, |
| 33 | +]; |
| 34 | + |
| 35 | +export const Default: Story = { |
| 36 | + render: () => { |
| 37 | + const [selectedId, setSelectedId] = useState(1); |
| 38 | + return ( |
| 39 | + <GroupList |
| 40 | + groups={groups} |
| 41 | + selectedId={selectedId} |
| 42 | + onSelect={setSelectedId} |
| 43 | + /> |
| 44 | + ); |
| 45 | + }, |
| 46 | + args: { groups }, |
| 47 | +}; |
0 commit comments