import { jsx as e, Fragment as P } from "react/jsx-runtime";
import { G as i, y as g, J as f, K as b, W as S } from "./index-ykl8OQ78.js";
import { useMemo as v, useState as C } from "react";
import { A as w } from "./AppCard-cTyZ7qdO.js";
import E from "./EventTypeAppSettingsInterface-rUp-tPsO.js";
const $ = function({
  app: a,
  eventType: p,
  eventTypeFormMetadata: c
}) {
  const t = i.useSearchParams(), { t: m } = g(), s = i.usePathname(), h = v(
    () => `${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: S + 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 {
  $ as default
};
