import { t as i, r as P, v as g, w as b, q as t, W as f } from "./index-jYYVpIDL.js";
import { useMemo as v, useState as x } from "react";
import { A as S } from "./AppCard-pSUVQRE0.js";
import w from "./EventTypeAppSettingsInterface-16gv7XPG.js";
const k = function({
  app: s,
  eventType: p,
  eventTypeFormMetadata: c
}) {
  const e = i.useSearchParams(), { t: m } = P(), a = i.usePathname(), h = v(
    () => `${a}${e ? `?${e.toString()}` : ""}`,
    [a, e]
  ), { getAppData: n, setAppData: d, disabled: l } = g(), [o, u] = x(n("enabled")), A = b(c), r = !o && A;
  return /* @__PURE__ */ t.jsx(
    S,
    {
      returnTo: f + h,
      app: s,
      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(
        w,
        {
          eventType: p,
          slug: s.slug,
          disabled: l,
          getAppData: n,
          setAppData: d
        }
      )
    }
  );
};
export {
  k as default
};
