import React from 'react';
import { Meta, Story } from '@storybook/react';
import { Tabs, TabsProps, Tab } from '../../../react/src/components/TabsVertical';

export default {
    title: 'Components/Tabs/Vertical Tabs ',
    component: Tabs,
    argTypes: {},
    parameters: {
        docs: {
            description: {
                story: 'A set of reusable UI elements designed to provide a consistent and user-friendly tabbed interface. With these components, you can easily implement tabbed layouts in your applications, allowing users to switch between different sections or views seamlessly.',
            },
        },
        canvas: {
            height: '230px',
        },

    },
} as Meta;

const Template: Story<TabsProps> = (args) => (
    <div style={{ height: '450px' }}>
        <Tabs {...args} />;
    </div>
)


const tabsData: Tab[] = [
    {
        label: 'Tab 1',
        content: <p>There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.</p>,
    },
    {
        label: 'Tab 2',
        content: <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>,
    },
    {
        label: 'Tab 3',
        content: <p>Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.</p>,
    },
];

export const Default = Template.bind({});
Default.args = {
    tabs: tabsData,

};
Default.storyName = 'Default Vertical Tabs';
Default.parameters = {
    docs: {
        description: {
            story: 'The default `Tabs` component displays a horizontal set of tabs with labels "Tab 1", "Tab 2", and "Tab 3". Clicking on each tab switches the content area to display the corresponding content. The default variant is useful for implementing a simple tabbed interface.',
        },
        viewMode: 'docs',
        docs: {
            page: {
                content: {
                    height: '230px',
                },
            },
        },
    },
};

export const VerticalTabs = Template.bind({});
VerticalTabs.args = {
    tabs: tabsData,

};
VerticalTabs.storyName = 'Vertical Tabs';
VerticalTabs.parameters = {
    docs: {
        description: {
            story: 'The `VerticalTabs` variant displays a vertical set of tabs with labels "Tab 1", "Tab 2", and "Tab 3" aligned vertically on the left side. Clicking on each tab switches the content area to display the corresponding content. This variant is useful when you want a vertical tab layout for better utilization of space or a different design aesthetic.',
        },
    },
};

export const TabsWithIcons = Template.bind({});
TabsWithIcons.args = {
    tabs: [
        {
            label: 'Tab 1',
            icon: <span>😎</span>,
            content: <p>Content for Tab 1 with icon 😎</p>,
        },
        {
            label: 'Tab 2',
            icon: <span>🤓</span>,
            content: <p>Content for Tab 2 with icon 🤓</p>,
        },
        {
            label: 'Tab 3',
            icon: <span>😊</span>,
            content: <p>Content for Tab 3 with icon 😊</p>,
        },
    ],

};
TabsWithIcons.storyName = 'Vertical Tabs with Icons';
TabsWithIcons.parameters = {
    docs: {
        description: {
            story: 'The `TabsWithIcons` variant showcases tabs with icons along with labels. It displays three tabs with icons: "🔍 Tab 1", "📝 Tab 2", and "💬 Tab 3". Clicking on each tab switches the content area to display the corresponding content. This variant is useful when you want to enhance the visual representation of each tab with icons.',
        },
        page: {
            content: {
                height: '230px',
            },
        },
    },
};

export const ScrollableTabs = Template.bind({});
ScrollableTabs.args = {
    tabs: tabsData,

};
ScrollableTabs.storyName = 'Scrollable Vertical Tabs';
ScrollableTabs.parameters = {
    docs: {
        description: {
            story: 'The `ScrollableTabs` variant demonstrates a horizontal set of tabs with labels "Tab 1", "Tab 2", and "Tab 3". If the tab labels exceed the available width, the tabs become scrollable, allowing users to access all tabs by scrolling horizontally. This variant is suitable for situations where there are numerous tabs and limited horizontal space.',
        },
    },
};
