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