import type { Meta, StoryObj } from '@storybook/react' import { useState } from 'react' import { Tab } from './Tab' const meta = { title: 'Components/Tab', component: Tab, args: { items: [], }, } satisfies Meta export default meta type Story = StoryObj const defaultItems = [ { key: 'tab1', label: '탭 1', children:
탭 1의 내용입니다.
}, { key: 'tab2', label: '탭 2', children:
탭 2의 내용입니다.
}, { key: 'tab3', label: '탭 3', children:
탭 3의 내용입니다.
}, ] export const Default: Story = { args: { items: defaultItems, }, } export const WithDefaultSelected: Story = { args: { items: defaultItems, defaultSelectedKey: 'tab2', }, } export const Controlled: Story = { render: function Render() { const [selectedKey, setSelectedKey] = useState('tab1') return ( setSelectedKey(key as string)} /> ) }, } export const WithDisabledTab: Story = { args: { items: [ { key: 'tab1', label: '탭 1', children:
탭 1의 내용입니다.
}, { key: 'tab2', label: '탭 2 (비활성화)', children:
탭 2의 내용입니다.
, disabled: true }, { key: 'tab3', label: '탭 3', children:
탭 3의 내용입니다.
}, ], }, } export const WithRichContent: Story = { args: { items: [ { key: 'overview', label: '개요', children: (

프로젝트 개요

이 프로젝트는 항공영상 탐지 시스템입니다.

  • 항공영상 업로드
  • AI 기반 객체 탐지
  • 결과 분석 및 리포트
), }, { key: 'details', label: '상세 정보', children: (

상세 정보

버전 1.0.0
최종 수정일 2024-01-15
), }, { key: 'settings', label: '설정', children: (

설정

), }, ], }, } export const ManyTabs: Story = { args: { items: [ { key: 'tab1', label: '첫 번째', children:
첫 번째 탭
}, { key: 'tab2', label: '두 번째', children:
두 번째 탭
}, { key: 'tab3', label: '세 번째', children:
세 번째 탭
}, { key: 'tab4', label: '네 번째', children:
네 번째 탭
}, { key: 'tab5', label: '다섯 번째', children:
다섯 번째 탭
}, ], }, } export const WithCustomClassName: Story = { args: { items: defaultItems, className: 'bg-gray-50 p-4 rounded-lg', tabPanelClassName: 'bg-white rounded border', }, }