import { Meta, StoryObj } from '@storybook/react-webpack5';
import List from '../../../list';
import { ListItem, type ListItemProps } from '../../ListItem';
import {
  SB_LIST_ITEM_ADDITIONAL_INFO as INFO,
  SB_LIST_ITEM_CONTROLS as CONTROLS,
  SB_LIST_ITEM_PROMPTS as PROMPT,
} from '../subcomponents';
import { generateVariantsForControl } from './helpers';

export default {
  component: ListItem,
  title: 'Content/ListItem/tests/variants/theme: personal',
  tags: ['!autodocs'],
  parameters: {
    controls: { disable: true },
    actions: { disable: true },
    knobs: { disable: true },
  },
} satisfies Meta<ListItemProps>;

type Story = StoryObj<ListItemProps>;

export const Button = generateVariantsForControl('button');
export const ButtonAsLink = generateVariantsForControl('buttonAsLink');
export const ButtonPartiallyInteractive = generateVariantsForControl('partialButton');
export const ButtonAsLinkPartiallyInteractive = generateVariantsForControl('partialButtonAsLink');
export const IconButton = generateVariantsForControl('iconButton');
export const IconButtonAsLink = generateVariantsForControl('iconButtonAsLink');
export const IconButtonWithLabel = generateVariantsForControl('iconButtonWithLabel');
export const IconButtonAsLinkWithLabel = generateVariantsForControl('iconButtonAsLinkWithLabel');
export const IconButtonPartiallyInteractive = generateVariantsForControl('partialIconButton');
export const IconButtonAsLinkPartiallyInteractive =
  generateVariantsForControl('partialIconButtonAsLink');
export const Navigation = generateVariantsForControl('navigation');
export const NavigationAsButton = generateVariantsForControl('navigationAsButton');
export const Checkbox = generateVariantsForControl('checkbox');
export const Radio = generateVariantsForControl('radio');
export const Switch = generateVariantsForControl('switch');
export const NonInteractive = generateVariantsForControl('non-interactive');

export const ButtonControlLabel: Story = {
  render: () => (
    <List>
      <ListItem
        title="Fully interactive button."
        subtitle="It uses default content hierarchy."
        valueTitle="100 GBP"
        valueSubtitle="200 USD"
        additionalInfo={INFO.nonInteractive}
        control={CONTROLS.button}
        prompt={PROMPT.nonInteractive}
      />

      <ListItem
        inverted
        title="Fully interactive button."
        subtitle="It uses inverted content hierarchy."
        valueTitle="100 GBP"
        valueSubtitle="200 USD"
        additionalInfo={INFO.nonInteractive}
        control={CONTROLS.button}
        prompt={PROMPT.nonInteractive}
      />

      <ListItem
        title="Fully interactive button as HTML anchor."
        subtitle="It uses default content hierarchy."
        valueTitle="100 GBP"
        valueSubtitle="200 USD"
        additionalInfo={INFO.nonInteractive}
        control={CONTROLS.buttonAsLink}
        prompt={PROMPT.nonInteractive}
      />

      <ListItem
        inverted
        title="Fully interactive button as HTML anchor."
        subtitle="It uses inverted content hierarchy."
        valueTitle="100 GBP"
        valueSubtitle="200 USD"
        additionalInfo={INFO.nonInteractive}
        control={CONTROLS.buttonAsLink}
        prompt={PROMPT.nonInteractive}
      />

      <ListItem
        title="Partially interactive button."
        subtitle="It uses default content hierarchy."
        valueTitle="100 GBP"
        valueSubtitle="200 USD"
        additionalInfo={INFO.nonInteractive}
        control={CONTROLS.partialButton}
        prompt={PROMPT.nonInteractive}
      />

      <ListItem
        inverted
        title="Partially interactive button."
        subtitle="It uses inverted content hierarchy."
        valueTitle="100 GBP"
        valueSubtitle="200 USD"
        additionalInfo={INFO.nonInteractive}
        control={CONTROLS.partialButton}
        prompt={PROMPT.nonInteractive}
      />

      <ListItem
        title="Partially interactive button as HTML anchor."
        subtitle="It uses default content hierarchy."
        valueTitle="100 GBP"
        valueSubtitle="200 USD"
        additionalInfo={INFO.nonInteractive}
        control={CONTROLS.partialButtonAsLink}
        prompt={PROMPT.nonInteractive}
      />

      <ListItem
        inverted
        title="Partially interactive button as HTML anchor."
        subtitle="It uses inverted content hierarchy."
        valueTitle="100 GBP"
        valueSubtitle="200 USD"
        additionalInfo={INFO.nonInteractive}
        control={CONTROLS.partialButtonAsLink}
        prompt={PROMPT.nonInteractive}
      />
    </List>
  ),
};
