import { jsx as t, Fragment as A } from "react/jsx-runtime";
import { q as y, r as g, s as b, t as f, W as P } from "./index-T-3isYi5.js";
import { useState as v } from "react";
import { A as C } from "./AppCard-JgJMoBtw.js";
import w from "./EventTypeAppSettingsInterface-AXZQXGmb.js";
const x = function({
  eventType: o,
  app: e,
  eventTypeFormMetadata: p,
  onAppInstallSuccess: i
}) {
  const { t: r } = y(), c = g.usePathname(), { getAppData: a, setAppData: m, disabled: d } = b(), [n, l] = v(a("enabled")), h = f(p), s = !n && h;
  return /* @__PURE__ */ t(
    C,
    {
      onAppInstallSuccess: i,
      returnTo: `${P}${c}?tabName=apps`,
      app: e,
      switchChecked: n,
      switchOnClick: (u) => {
        l(u);
      },
      description: /* @__PURE__ */ t(A, { children: "Add lightning payments to your events and booking" }),
      disableSwitch: s,
      switchTooltip: s ? r("other_payment_app_enabled") : void 0,
      children: /* @__PURE__ */ t(
        w,
        {
          eventType: o,
          slug: e.slug,
          disabled: d,
          getAppData: a,
          setAppData: m
        }
      )
    }
  );
};
export {
  x as default
};
