import React from "react";
import {
  Title,
  Subtitle,
  Description,
  Primary,
} from "@storybook/addon-docs/blocks";
import { Badge } from "../../../../src/atoms/badge";
import { ListGroup, ListGroupItem } from "../../../../src/atoms/listgroup";
import { NavLink } from "../../../../src/atoms/nav";

export default {
  title: "Components/ListGroup",
  component: ListGroup,
  parameters: {
    docs: {
      page: () => (
        <>
          <Title>Readme</Title>
          <br />
          <Subtitle>
            Note, thise story is explains more about the basic usage of the
            component in your project, how to import and render it. You may find
            examples of code at the story Example.
          </Subtitle>
          <Description>
            You may use `ListGroup` for editional navigation or informing user on specific blocks. To setup it for the needs of your product, you may use
            next `props`:
          </Description>
          <Description>1. `action`</Description>
          <Description>2. `active`</Description>
          <Description>3. `disabled`</Description>
          <Description>4. `flush`</Description>
          <Description>5. `primary`</Description>
          <Description>6. `secondary`</Description>
          <Description>7. `success`</Description>
          <Description>8. `danger`</Description>
          <Description>9. `warning`</Description>
          <Description>10. `info`</Description>
          <Description>11. `light`</Description>
          <Description>12. `dark`</Description>
          <br />
          <Subtitle>
            To integrate ListGroup for using at your product, please read the
            information below, or check the example code in stories.
          </Subtitle>
          <Description>
            1. `import &#123; ListGroup, ListGroupItem &#125; from 'seturon';`
          </Description>
          <Description>2. Set the component on the needed page.</Description>
          <Description>3. Set needed `props` at the component.</Description>
          <br />
          <Subtitle>
            To have more idea about the code and usage of the ListGroup components,
            check it out:
          </Subtitle>
          <NavLink href="http://design.seturon.io/?path=/docs/components-listgroup--example">
            Example
          </NavLink>
        </>
      ),
    },
  },
  args: {
    action: true,
    active: false,
    disabled: false,
    flush: false,
    primary: false,
    secondary: false,
    success: false,
    danger: false,
    warning: false,
    info: false,
    light: false,
    dark: false,

  },
  argTypes: {
    props: {
      description: null,
      table: {
        type: {
          summary: null,
          detail: null,
        },
      },
      control: {
        type: null,
      },
    },
  },
};

export const Readme = (args) => (
  <ListGroup {...args}>
    <ListGroupItem {...args}>JavaScript, jQuery, and JSON</ListGroupItem>
    <ListGroupItem>Using JavaScript, JQuery, and JSON in Django</ListGroupItem>
    <ListGroupItem>Information Visualization: Programming with D3.js</ListGroupItem>
    <ListGroupItem>JSON and Natural Language Processing in PostgreSQL</ListGroupItem>
  </ListGroup>
);

export const Example = () => (
  <ListGroup>
    <ListGroupItem action>
      <a href="">JavaScript, jQuery, and JSON</a>
    </ListGroupItem>
    <ListGroupItem action>
      <a href="">Using JavaScript, JQuery, and JSON in Django</a>
      <Badge pill primary>
        1
      </Badge>
    </ListGroupItem>
    <ListGroupItem>
      Information Visualization: Programming with D3.js
    </ListGroupItem>
    <ListGroupItem action disabled>
      <a href="">JSON and Natural Language Processing in PostgreSQL</a>
    </ListGroupItem>
  </ListGroup>
);

Example.storyName = "Example";

Example.parameters = {
  component: ListGroup,
  docs: {
    page: () => (
      <>
        <Title>Example</Title>
        <Subtitle>Props</Subtitle>
        <Description>
            You may use `ListGroup` for editional navigation or informing user on specific blocks. To setup it for the needs of your product, you may use
            next `props`:
          </Description>
          <Description>1. `action`</Description>
          <Description>2. `active`</Description>
          <Description>3. `disabled`</Description>
          <Description>4. `flush`</Description>
          <Description>5. `primary`</Description>
          <Description>6. `secondary`</Description>
          <Description>7. `success`</Description>
          <Description>8. `danger`</Description>
          <Description>9. `warning`</Description>
          <Description>10. `info`</Description>
          <Description>11. `light`</Description>
          <Description>12. `dark`</Description>
          <br />
        <Subtitle>
          Check the code below to get an idea of how to use it at your product👇
        </Subtitle>
        <Primary name="Example" />
      </>
    ),
  },
};
