import React from 'react';
import {CascadeSelectSingleComponent as CascadeSelectSingle} from './cascade-select-single.component';
import type {Meta, StoryObj} from '@storybook/react';

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

type Story = StoryObj<typeof CascadeSelectSingle>;

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',
            },
        ],
    },
];

export const Default: Story = {
    render: (args) => <CascadeSelectSingle {...args} />,
    args: {
        options: options,
        value: {label: 'text', value: '100-100'},
        className: 'ltr',
    },
};
