import { Meta, Preview, Props, Story } from "@storybook/addon-docs/blocks";
import { boolean, select, text, array } from "@storybook/addon-knobs";
import WarningMessages from "../../WarningMessages";
import StorybookContainer from "../../../shared/StorybookContainer";
import IconShare from "../../Icons/IconShare";

<Meta title="WarningMessages" />

# WarningMessages

<Story name="Demo" parameters={{ options: { showPanel: true } }}>
  {{
    components: {
      "h-warning-messages": WarningMessages,
      StorybookContainer,
    },
    props: {
      type: {
        default: select(
          "type",
          {
            standard: "standard",
            restricted: "restricted",
            prohibited: "prohibited",
          },
          "standard",
        ),
      },
      bgColor: {
        default: select(
          "Background Color",
          {
            mono: "mono",
            white: "white",
          },
          "mono",
        ),
      },
    },
    template: `
          <div>
            <StorybookContainer style="background-color: #9ad1ed; padding: 0 100px; width: 100vw">
              <h-warning-messages :type="type" :bgColor="bgColor" />
              <br />
            </StorybookContainer>
          </div> `,
  }}
  }
</Story>

<Story name="Custom content" parameters={{ options: { showPanel: false } }}>
  {{
    components: {
      "h-warning-messages": WarningMessages,
      StorybookContainer,
      "icon-share": IconShare
    },
    template: `
          <div>
            <StorybookContainer style="background-color: #9ad1ed; padding: 0 100px; width: 100vw">
              <h-warning-messages type="prohibited">
              <p>
                  We're now unable to accept this parcel profile. Please check our
                  <a href="https://www.myhermes.co.uk/send-a-parcel/prohibited-items" target="_blank">
                    prohibited items list<icon-share class="u-color-fill-fiord" :width="16" :height="16"/>
                  </a>
                  <br />
                  Please select a different parcel profile.
                </p>
              </h-warning-messages>
              <br />
            </StorybookContainer>
          </div> `,
  }}
  }
</Story>

<Props of={WarningMessages} />
