import React from "react";
import {
  Title,
  Subtitle,
  Description,
  Primary,
} from "@storybook/addon-docs/blocks";
import { Badge, H3, H4, AddIcon, BadgeIcon, NavLink } from "../../../../src";

export default {
  title: "Components/Badge",
  component: Badge,
  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>
            `Badge` are usefull components for point the important information,
            number of lessons, etc. There are 11 types of the `Badge` collor,
            which can be used in different cases. To apply the needed color by
            using a `props`:
          </Description>
          <Description>1. `primary` the primary color.</Description>
          <Description>2. `secondary` secondary color.</Description>
          <Description>3. `success` success color.</Description>
          <Description>4. `warning` warning color.</Description>
          <Description>5. `dark` dark color.</Description>
          <Description>6. `danger` danger color.</Description>
          <Description>7. `math` math color.</Description>
          <Description>8. `marketing` marketing color.</Description>
          <Description>9. `vocabulary` vocabulary color.</Description>
          <Description>10. `philosophy` philosophy color.</Description>
          <Description>
            11. If you didn't set any of the `props`, you will have default
            color.
          </Description>
          <br />
          <Description>
            Also, you may set the radius of the `Badge` and `BadgeIcon` by
            setting the following `props`:
          </Description>
          <Description>- `pill` to make the `Badge` round.</Description>
          <Description>
            - `iconRadius` to make the `BadgeIcon` round.
          </Description>
          <br />
          <Subtitle>
            To integrate Badge for using at your product, please read the
            information below, or check the example code in stories.
          </Subtitle>
          <Description>
            1. `import &#123; Badge &#125; from 'seturon';` or `import &#123;
            BadgeIcon &#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 Badge components,
            check it out:
          </Subtitle>
          <NavLink href="http://design.seturon.io/?path=/docs/components-badge--example">
            Example
          </NavLink>
        </>
      ),
    },
  },
  args: {
    pill: true,
    iconRadius: false,
    primary: false,
    secondary: false,
    success: false,
    warning: false,
    dark: false,
    danger: false,
    math: false,
    marketing: false,
    vocabulary: false,
    philosophy: false,
  },
  argTypes: {
    props: {
      description: null,
      table: {
        type: {
          summary: null,
          detail: null,
        },
      },
      control: {
        type: null,
      },
    },
  },
};

export const Rreadme = (args) => (
  <>
    <Badge m2 {...args}>
      1
    </Badge>
  </>
);

export const Example = () => (
  <>
    <Badge m1 primary pill>
      1
    </Badge>
    <Badge m1 secondary pill>
      10
    </Badge>
    <Badge m1 success pill>
      100
    </Badge>
    <Badge m1 warning pill>
      1000
    </Badge>
    <Badge m1 danger pill>
      10000
    </Badge>
    <Badge m1 pill>
      default
    </Badge>
    <Badge m1 pill math>
      math
    </Badge>
    <Badge m1 pill marketing>
      marketing
    </Badge>
    <Badge m1 pill vocabulary>
      vocabulary
    </Badge>
    <Badge m1 pill philosophy>
      philosophy
    </Badge>
    <br />
    <BadgeIcon
      m1
      primary
      iconRadius
      icon={<AddIcon width={32} height={32} fill={"#fff"} />}
    />
  </>
);

Example.storyName = "Example";

Example.parameters = {
  component: Badge,
  docs: {
    page: () => (
      <>
        <Title>Example</Title>
        <Subtitle>Props</Subtitle>
        <Description>
          `Badge` are usefull components for point the important information,
          number of lessons, etc. There are 11 types of the `Badge` collor,
          which can be used in different cases. To apply the needed color by
          using a `props`:
        </Description>
        <Description>1. `primary` the primary color.</Description>
        <Description>2. `secondary` secondary color.</Description>
        <Description>3. `success` success color.</Description>
        <Description>4. `warning` warning color.</Description>
        <Description>5. `dark` dark color.</Description>
        <Description>6. `danger` danger color.</Description>
        <Description>7. `math` math color.</Description>
        <Description>8. `marketing` marketing color.</Description>
        <Description>9. `vocabulary` vocabulary color.</Description>
        <Description>10. `philosophy` philosophy color.</Description>
        <Description>
          11. If you didn't set any of the `props`, you will have default color.
        </Description>
        <br />
        <Description>
          To setup the `Badge` or `BadgeIcon` componentby use the following
          `props`:
        </Description>
        <Description>- `pill` to make the `Badge` round.</Description>
        <Description>- `iconRadius` to make the `BadgeIcon` round.</Description>
        <Description>
          - `icon` using this props, you may integrate any of the Icons form
          `seturon` and use it at your `BadgeIcon` component
        </Description>
        <br />
        <Subtitle>
          Check the code below to get an idea of how to use it at your product👇
        </Subtitle>
        <Primary name="Example" />
      </>
    ),
  },
};
