import { h } from "@stencil/core";
import { PortalEmailVerificationView, } from "./sqm-portal-email-verification-view";
import scenario from "./sqm-portal-email-verification.feature";
export default {
  title: "Components/Microsite Email Verification",
  parameters: {
    scenario,
  },
};
const defaultCallbacks = {
  submit: async (e) => await e,
};
const defaultContent = {
  email: "email@example.com",
  verifyMessage: "A verification email was sent to {email}. Please verify your email to continue to the portal.",
  emailVerificationHeader: "Verify your email",
  resendEmailButtonText: "Re-send Email",
  verificationStatusMessage: "Checking verification status in {countdown}",
  verificationLoadingMessage: "Checking verification status",
  verificationResentMessage: "Verification email resent to {email}",
};
const defaultStates = {
  error: "",
  loading: false,
  success: false,
  isVerified: false,
  loadingVerification: false,
  countdown: 10,
};
const defaultProps = {
  states: defaultStates,
  callbacks: defaultCallbacks,
  content: defaultContent,
};
const errorProps = {
  states: {
    ...defaultStates,
    error: "Something went wrong. Please try again.",
  },
  callbacks: defaultCallbacks,
  content: defaultContent,
};
const loadingProps = {
  states: {
    ...defaultStates,
    loading: true,
  },
  callbacks: defaultCallbacks,
  content: defaultContent,
};
const successProps = {
  states: {
    ...defaultStates,
    success: true,
    isVerified: true,
  },
  callbacks: defaultCallbacks,
  content: defaultContent,
};
const loadingVerificationProps = {
  states: {
    ...defaultStates,
    loadingVerification: true,
  },
  callbacks: defaultCallbacks,
  content: defaultContent,
};
export const Default = () => h(PortalEmailVerificationView, Object.assign({}, defaultProps));
export const EmailVerificationWithError = () => (h(PortalEmailVerificationView, Object.assign({}, errorProps)));
export const EmailVerificationLoading = () => (h(PortalEmailVerificationView, Object.assign({}, loadingProps)));
export const EmailVerificationCheckingVerification = () => (h(PortalEmailVerificationView, Object.assign({}, loadingVerificationProps)));
export const EmailVerificationSuccess = () => (h(PortalEmailVerificationView, Object.assign({}, successProps)));
