import React from 'react';
import {CascadeComponent as Cascade} from './cascade.component';
import type {Meta, StoryObj} from '@storybook/react';

const options = [
    {
        label: '福建',
        value: 'fj',
        children: [
            {
                label: '福州',
                value: 'fuzhou',
                children: [
                    {
                        label: '马尾',
                        value: 'mawei',
                    },
                ],
            },
            {
                label: '泉州',
                value: 'quanzhou',
            },
        ],
    },
    {
        label: '浙江',
        value: 'zj',
        children: [
            {
                label: '杭州',
                value: 'hangzhou',
                children: [
                    {
                        label: '余杭',
                        value: 'yuhang',
                    },
                ],
            },
        ],
    },
    {
        label: '北京',
        value: 'bj',
        children: [
            {
                label: '朝阳区',
                value: 'chaoyang',
            },
            {
                label: '海淀区',
                value: 'haidian',
            },
        ],
    },
];

const meta: Meta<typeof Cascade> = {
    title: 'Organisms/Cascade',
    component: Cascade,
};
export default meta;

type Story = StoryObj<typeof Cascade>;

export const Default: Story = {
    render: (args) => <Cascade {...args} />,
    args: {
        options: options,
        value: [['100']],
    },
};
