import { aL as i, aK as P, aM as g, aN as b, aJ as t, aO as f } from "./index-THhC4TET.js";
import { useMemo as x, useState as S } from "react";
import { A as v } from "./AppCard-1cD7do0L.js";
import C from "./EventTypeAppSettingsInterface--4AaeXDT.js";
const k = 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 {
  k as default
};
