import { jsx as e, Fragment as P } from "react/jsx-runtime";
import { s as i, q as g, t as f, v as b, W as v } from "./index-ZQlxzdt5.js";
import { useMemo as S, useState as C } from "react";
import { A as w } from "./AppCard-cTGNOAHy.js";
import E from "./EventTypeAppSettingsInterface-_jGTLesb.js";
const W = function({
  app: a,
  eventType: p,
  eventTypeFormMetadata: c
}) {
  const t = i.useSearchParams(), { t: m } = g(), s = i.usePathname(), h = S(
    () => `${s}${t ? `?${t.toString()}` : ""}`,
    [s, t]
  ), { getAppData: n, setAppData: d, disabled: l } = f(), [o, u] = C(n("enabled")), A = b(c), r = !o && A;
  return /* @__PURE__ */ e(
    w,
    {
      returnTo: v + h,
      app: a,
      switchChecked: o,
      switchOnClick: (y) => {
        u(y);
      },
      description: /* @__PURE__ */ e(P, { children: "Add bitcoin lightning payments to your events" }),
      disableSwitch: r,
      switchTooltip: r ? m("other_payment_app_enabled") : void 0,
      children: /* @__PURE__ */ e(
        E,
        {
          eventType: p,
          slug: a.slug,
          disabled: l,
          getAppData: n,
          setAppData: d
        }
      )
    }
  );
};
export {
  W as default
};
