import { h } from "@stencil/core";
import { ChangeMarktingView } from "./sqm-portal-change-marketing-view";
export default {
  title: "Components/Change Marketing Emails Status",
};
const defaultProps = {
  states: {
    success: false,
    loading: false,
    submitDisabled: false,
    formState: {
      marketingEmailOptIn: false,
      errors: null,
      error: "",
    },
    user: {
      id: "zach",
      accountId: "zach",
      marketingEmailOptIn: false,
    },
    text: {
      emailPreferencesHeader: "Email preferences",
      marketingCheckboxLabel: "I want to receive marketing emails and promotions for this referral program from impact.com",
      submitChangeButtonText: "Save",
      successMessage: "Opt-in preference has been changed.",
    },
  },
  callbacks: {
    onSubmit: (props) => console.log(props),
    setChecked: (value) => console.log(value),
  },
};
export const Default = () => {
  return h("sqm-portal-change-marketing", null);
};
export const Loading = () => {
  return (h(ChangeMarktingView, Object.assign({}, defaultProps, { states: { ...defaultProps.states, loading: true } })));
};
export const Error = () => {
  return (h(ChangeMarktingView, Object.assign({}, defaultProps, { states: {
      ...defaultProps.states,
      formState: {
        ...defaultProps.states.formState,
        errors: { error: true },
        error: "An error string",
      },
    } })));
};
export const Success = () => {
  return (h(ChangeMarktingView, Object.assign({}, defaultProps, { states: {
      ...defaultProps.states,
      success: true,
    } })));
};
