import { h } from "@stencil/core";
import { PortalResetPasswordView, } from "./sqm-portal-reset-password-view";
import scenario from "./sqm-portal-reset-password.feature";
export default {
  title: "Components/Microsite Reset Password",
  parameters: {
    scenario,
  },
};
const defaultProps = {
  states: {
    error: "",
    loading: false,
    reset: false,
    confirmPassword: true,
    oobCodeValidating: false,
    oobCodeValid: true,
    content: {
      passwordResetHeader: "Password reset",
      resetPasswordHeader: "Reset your password",
      continueButtonText: "Continue",
      resetPasswordButtonText: "Reset Password",
      confirmPasswordFieldLabel: "Confirm Password",
      passwordFieldLabel: "New Password",
    },
  },
  callbacks: {
    submit: async (e) => await e,
    gotoNextPage: () => console.log("next page"),
    failed: () => console.log("failed"),
  },
};
const defaultPropsNoConfirm = {
  states: {
    error: "",
    loading: false,
    reset: false,
    confirmPassword: false,
    oobCodeValidating: false,
    oobCodeValid: true,
    content: {
      passwordResetHeader: "Password reset",
      resetPasswordHeader: "Reset your password",
      continueButtonText: "Continue",
      resetPasswordButtonText: "Reset Password",
      confirmPasswordFieldLabel: "Confirm Password",
      passwordFieldLabel: "New Password",
    },
  },
  callbacks: {
    submit: async (e) => await e,
    gotoNextPage: () => console.log("next page"),
    failed: () => console.log("failed"),
  },
};
const errorProps = {
  states: {
    error: "Something went wrong. Please try again.",
    loading: false,
    reset: false,
    confirmPassword: true,
    oobCodeValidating: false,
    oobCodeValid: true,
    content: {
      passwordResetHeader: "Password reset",
      resetPasswordHeader: "Reset your password",
      continueButtonText: "Continue",
      resetPasswordButtonText: "Reset Password",
      confirmPasswordFieldLabel: "Confirm Password",
      passwordFieldLabel: "New Password",
    },
  },
  callbacks: {
    submit: async (e) => await e,
    gotoNextPage: () => console.log("next page"),
    failed: () => console.log("failed"),
  },
};
const loadingProps = {
  states: {
    error: "",
    loading: true,
    reset: false,
    confirmPassword: true,
    oobCodeValidating: false,
    oobCodeValid: true,
    content: {
      passwordResetHeader: "Password reset",
      resetPasswordHeader: "Reset your password",
      continueButtonText: "Continue",
      resetPasswordButtonText: "Reset Password",
      confirmPasswordFieldLabel: "Confirm Password",
      passwordFieldLabel: "New Password",
    },
  },
  callbacks: {
    submit: async (e) => await e,
    gotoNextPage: () => console.log("next page"),
    failed: () => console.log("failed"),
  },
};
const successProps = {
  states: {
    error: "",
    loading: false,
    reset: true,
    confirmPassword: true,
    oobCodeValidating: false,
    oobCodeValid: true,
    content: {
      passwordResetHeader: "Password reset",
      resetPasswordHeader: "Reset your password",
      continueButtonText: "Continue",
      resetPasswordButtonText: "Reset Password",
      confirmPasswordFieldLabel: "Confirm Password",
      passwordFieldLabel: "New Password",
    },
  },
  callbacks: {
    submit: async (e) => await e,
    gotoNextPage: () => console.log("next page"),
    failed: () => console.log("failed"),
  },
};
const validatingCodeProps = {
  states: {
    error: "",
    loading: false,
    reset: false,
    confirmPassword: true,
    oobCodeValidating: false,
    oobCodeValid: false,
    content: {
      passwordResetHeader: "Password reset",
      resetPasswordHeader: "Reset your password",
      continueButtonText: "Continue",
      resetPasswordButtonText: "Reset Password",
      confirmPasswordFieldLabel: "Confirm Password",
      passwordFieldLabel: "New Password",
    },
  },
  callbacks: {
    submit: async (e) => await e,
    gotoNextPage: () => console.log("next page"),
    failed: () => console.log("failed"),
  },
};
export const Default = () => h(PortalResetPasswordView, Object.assign({}, defaultProps));
export const DefaultWithoutConfirmField = () => (h(PortalResetPasswordView, Object.assign({}, defaultPropsNoConfirm)));
export const ResetPasswordWithError = () => (h(PortalResetPasswordView, Object.assign({}, errorProps)));
export const ResetPasswordLoading = () => (h(PortalResetPasswordView, Object.assign({}, loadingProps)));
export const ResetPasswordSuccess = () => (h(PortalResetPasswordView, Object.assign({}, successProps)));
export const CodeValidating = () => (h(PortalResetPasswordView, Object.assign({}, validatingCodeProps)));
