import { h } from "@stencil/core";
import { EmailRegistrationView, } from "./email-registration-view";
// import scenario from "./ShareCode.feature";
export default {
  title: "Components/Email Registration",
  parameters: {
  // scenario,
  },
};
const defaultProps = {
  states: {
    error: "",
    loading: false,
  },
  callbacks: {
    submit: async (e) => await e,
  },
  content: {
    invalidEmailErrorMessage: "Must be a valid email address",
    requiredFieldErrorMessage: "Cannot be empty",
    paddingTop: "large",
    paddingRight: "large",
    paddingBottom: "large",
    paddingLeft: "large",
    fraudErrorMessage: "Our team will review this referral. If approved, you and your friend will receive your rewards. Need help? Reach out to our Support team.",
    fraudErrorMessageTitle: "Looks like you tried referring yourself",
  },
};
export const Default = () => h(EmailRegistrationView, Object.assign({}, defaultProps));
export const HasFirstNameLastName = () => (h(EmailRegistrationView, Object.assign({}, {
  ...defaultProps,
  content: {
    ...defaultProps.content,
    includeName: true,
  },
})));
export const WithSlots = () => (h(EmailRegistrationView, Object.assign({}, {
  ...defaultProps,
  content: {
    ...defaultProps.content,
    topSlot: h("div", null, "Hello this is the top slot"),
    bottomSlot: h("div", null, "Hello this is the bottom slot"),
  },
})));
export const NoBorder = () => (h(EmailRegistrationView, Object.assign({}, {
  ...defaultProps,
  content: {
    ...defaultProps.content,
    hideBorder: true,
  },
})));
export const BackgroundColor = () => (h(EmailRegistrationView, Object.assign({}, {
  ...defaultProps,
  content: {
    ...defaultProps.content,
    backgroundColor: "aquamarine",
  },
})));
export const Loading = () => (h(EmailRegistrationView, Object.assign({}, {
  ...defaultProps,
  states: {
    error: "",
    loading: true,
  },
})));
export const Error = () => (h(EmailRegistrationView, Object.assign({}, {
  ...defaultProps,
  states: {
    error: "Something went wrong. Please try again.",
    loading: false,
  },
})));
export const FraudError = () => (h(EmailRegistrationView, Object.assign({}, {
  ...defaultProps,
  states: {
    error: "FRAUD",
    loading: false,
  },
})));
export const EmptyEmailError = () => (h(EmailRegistrationView, Object.assign({}, {
  ...defaultProps,
  states: {
    error: "Something went wrong. Please try again.",
    loading: false,
    registrationFormState: {
      validationErrors: { email: "Email cannot be empty" },
    },
  },
})));
