/**
 * TEAM: frontend_infra
 *
 * @flow
 */

import {StyleSheet, css} from "aphrodite";
import {storiesOf} from "@storybook/react";
import {withKnobs} from "@storybook/addon-knobs";
import sections from "../sections";
import Group from "../../Group";
import Banner from "../../Banner";
import Button from "../../button/Button";
import Text from "../../Text";

// $FlowFixMe[invalid-export]
const stories = storiesOf(`${sections.interaction}/Banner`, module);
stories.addDecorator(withKnobs);
stories.add("Banner Intents", () => (
  <div className={css(styles.container)}>
    <Group flexDirection="column" gap={36}>
      <Banner
        message={
          <Text>
            You cannot edit an automatic <Text weight="bold">On Duty Log.</Text>
          </Text>
        }
        additionalContent="Test"
        iconName="attention"
        intent="default"
        onClose={() => {}}
        ctaButton={
          <Button label="Create new log" intent="basic" kind="blank" />
        }
      />
      <Banner
        message="You cannot edit an automatic On Duty Log. You’ll need to create a new log."
        iconName="attention"
        intent="default-light"
        onClose={() => {}}
        ctaButton={
          <Button label="Create new log" intent="basic" kind="blank" />
        }
      />
      <Banner
        message="You cannot edit an automatic On Duty Log. You’ll need to create a new log."
        iconName="attention"
        intent="warning"
        onClose={() => {}}
        ctaButton={<Button label="Click here" intent="basic" kind="solid" />}
      />
      <Banner
        message="You cannot edit an automatic On Duty Log. You’ll need to create a new log."
        iconName="attention"
        intent="error-hollow"
        onClose={() => {}}
        ctaButton={
          <Button label="Create new log" intent="basic" kind="blank" />
        }
      />
      <Banner
        message="You cannot edit an automatic On Duty Log. You’ll need to create a new log."
        iconName="attention"
        intent="error"
        onClose={() => {}}
      />
    </Group>
  </div>
));

const styles = StyleSheet.create({
  container: {
    width: "600px",
  },
});
