import { aM as i, aL as y, aN as g, aO as b, aK as t, aP as f } from "./index-GTnBs7av.js";
import { useMemo as x, useState as S } from "react";
import { A as v } from "./AppCard-Q28K7Yaw.js";
import C from "./EventTypeAppSettingsInterface-CjC9Ut2a.js";
const k = function({
  app: a,
  eventType: p,
  eventTypeFormMetadata: c
}) {
  const e = i.useSearchParams(), { t: m } = y(), 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: (P) => {
        u(P);
      },
      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
};
