import React from "react";
import {
  Title,
  Subtitle,
  Description,
  Primary,
} from "@storybook/addon-docs/blocks";
import { Breadcrumb, BreadcrumbItem } from "../../../../src/atoms/breadcrumb";
import { LinkButton } from "../../../../src/atoms/button";
import { NavLink } from "../../../../src/atoms/nav";

export default {
  title: "Components/Breadcrumb",
  component: Breadcrumb,
  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>
            `Breadcrumb` is useful for organizing the additional navigation at
            the web pages. You may design you `Breadcrumb` menu by using:
          </Description>
          <Description>
            1. `import &#123; Breadcrumb &#125; from 'seturon';` at the needed
            page
          </Description>
          <Description>
            2. `import &#123; BreadcrumbItem &#125; from 'seturon';` at the
            needed page
          </Description>
          <Description>
            3. Import aditional components, such as `LinkButton` to have the
            `Breadcrumb` menu alive
          </Description>
          <Description>4. Set needed `props` at the component.</Description>
          <br />
          <Subtitle>
            To have more idea about the code and usage of the Breadcrumb and
            BreadcrumbItem components, check it out:
          </Subtitle>
          <NavLink href="http://design.seturon.io/?path=/docs/components-breadcrumb--example">
            Example
          </NavLink>
        </>
      ),
    },
  },
  args: {
    primary: true,
  },
  argTypes: {
    props: {
      description: null,
      table: {
        type: {
          summary: null,
          detail: null,
        },
      },
      control: {
        type: null,
      },
    },
  },
};

export const Readme = (args) => (
  <>
    <Breadcrumb>
      <BreadcrumbItem>
        <LinkButton {...args} href="#">
          Home
        </LinkButton>
      </BreadcrumbItem>
      <BreadcrumbItem>
        <LinkButton href="#">Menu</LinkButton>
      </BreadcrumbItem>
    </Breadcrumb>
  </>
);

export const Example = () => (
  <>
    <Breadcrumb>
      <BreadcrumbItem>
        <LinkButton primary href="#">
          Home
        </LinkButton>
      </BreadcrumbItem>
      <BreadcrumbItem>
        <LinkButton secondary href="#">
          Menu
        </LinkButton>
      </BreadcrumbItem>
      <BreadcrumbItem>
        <LinkButton secondary href="#">
          Profile
        </LinkButton>
      </BreadcrumbItem>
    </Breadcrumb>
  </>
);

Example.storyName = "Example";

Example.parameters = {
  component: Breadcrumb,
  docs: {
    page: () => (
      <>
        <Title>Example</Title>
        <Subtitle>
          Breadcrumb is useful for organizing the additional navigation at the
          web pages. You may design you Breadcrumb menu by using:
        </Subtitle>
        <Description>
          1. `import &#123; Breadcrumb &#125; from 'seturon';` at the needed
          page
        </Description>
        <Description>
          2. `import &#123; BreadcrumbItem &#125; from 'seturon';` at the needed
          page
        </Description>
        <Description>
          3. Import aditional components, such as `LinkButton` to have the
          `Breadcrumb` menu alive
        </Description>
        <Description>4. Set needed `props` at the component.</Description>
        <br />
        <Subtitle>
          Check the code below to get an idea of how to use it at your product👇
        </Subtitle>
        <Primary name="Example" />
      </>
    ),
  },
};
