import React from "react";
import {
  Title,
  Subtitle,
  Description,
  Primary,
} from "@storybook/addon-docs/blocks";
import { Container } from "../../../../src/atoms/container";
import { NavLink } from "../../../../src/atoms/nav";

export default {
  title: "Components/Container",
  component: Container,
  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>
            `Container` for visual appearance and organizing other components on
            the screen orderly. There are 3 types of the `Container` which you
            may use as a `props`:
          </Description>
          <Description>
            1. `fluid` by using this `props` you make the `Container` full
            screen on width.
          </Description>
          <Description>
            2. `fluidHeight` by using this `props` you make the `Container` full
            screen on height, it will follow the `body`.
          </Description>
          <Description>
            By default `Container` will have a standart appearance for
            organizing content.
          </Description>
          <br />
          <Subtitle>
            To integrate Container for using at your product, please read the
            information below, or check the example code in stories.
          </Subtitle>
          <Description>
            1. `import &#123; Container &#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 Container
            component, check it out:
          </Subtitle>
          <NavLink href="http://design.seturon.io/?path=/docs/components-container--example">
            Example
          </NavLink>
        </>
      ),
    },
  },
  args: {
    fluid: false,
    fluidHeight: false,
  },
  argTypes: {
    props: {
      description: null,
      table: {
        type: {
          summary: null,
          detail: null,
        },
      },
      control: {
        type: null,
      },
    },
  },
};

export const Readme = (args) => (
  <Container p5 bgPrimary textCenter {...args}>
    To understand how it works, check it in a full screen mode
  </Container>
);

export const Example = () => (
  <>
    <Container p4 bgPrimary>
      Container
    </Container>
    <br />
    <Container p4 bgPrimary fluid>
      Fluid container
    </Container>
    <br />
    <Container p4 bgPrimary fluidHeight>
      Fluid height container
    </Container>
  </>
);

Example.storyName = "Example";

Example.parameters = {
  component: Container,
  docs: {
    page: () => (
      <>
        <Title>Example</Title>
        <Subtitle>Props</Subtitle>
        <Description>
          `Container` for visual appearance and organizing other components on
          the screen orderly. There are 3 types of the `Container` which you may
          use as a `props`:
        </Description>
        <Description>
          1. `fluid` by using this `props` you make the `Container` full screen
          on width.
        </Description>
        <Description>
          2. `fluidHeight` by using this `props` you make the `Container` full
          screen on height, it will follow the `body`.
        </Description>
        <Description>
          By default `Container` will have a standart appearance for organizing
          content.
        </Description>
        <br />
        <Subtitle>
          Check the code below to get an idea of how to use it at your product👇
        </Subtitle>
        <Primary name="Example" />
      </>
    ),
  },
};
