import { jsx as e } from "../../../../../external/.pnpm/preact@10.28.2/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js";
import { PaymentLinkCreationFormContainer as l } from "../PaymentLinkCreationFormContainer/PaymentLinkCreationFormContainer.js";
/* empty css                             */
import { useState as n } from "../../../../../external/.pnpm/preact@10.28.2/node_modules/preact/hooks/dist/hooks.module.js";
import { FormSuccess as u } from "../Form/FormSuccess/FormSuccess.js";
import { PaymentLinkDetails as y } from "../../../PaymentLinkDetails/components/PaymentLinkDetails/PaymentLinkDetails.js";
const P = (r) => {
  const [i, a] = n("Creation"), [o, s] = n(""), [m, c] = n("");
  return /* @__PURE__ */ e("div", { className: "adyen-pe-payment-link-creation", children: (() => {
    switch (i) {
      case "Creation":
        return /* @__PURE__ */ e(
          l,
          {
            ...r,
            onPaymentLinkCreated: (t) => {
              r.onPaymentLinkCreated?.(t), s(t.paymentLink?.url ?? ""), c(t.paymentLink?.paymentLinkId ?? ""), a("Success");
            }
          }
        );
      case "Success":
        return /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(u, { paymentLinkUrl: o, onGoToDetails: () => a("Details") }) });
      case "Details":
        return /* @__PURE__ */ e(y, { id: m });
      default:
        return null;
    }
  })() });
};
export {
  P as default
};
