import { jsx as t, Fragment as A } from "react/jsx-runtime";
import { o as y, p as g, q as b, r as f, W as P } from "./index-C62tPk5p.js";
import { useState as v } from "react";
import { A as C } from "./AppCard-CQEg94Y3.js";
import E from "./EventTypeAppSettingsInterface-CyXMHuwE.js";
const q = function({
  eventType: p,
  app: e,
  eventTypeFormMetadata: s,
  onAppInstallSuccess: r
}) {
  const { t: i } = y(), c = g.usePathname(), { getAppData: a, setAppData: m, disabled: d } = b(), [n, l] = v(a("enabled")), h = f(s), o = !n && h;
  return /* @__PURE__ */ t(
    C,
    {
      onAppInstallSuccess: r,
      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: o,
      switchTooltip: o ? i("other_payment_app_enabled") : void 0,
      children: /* @__PURE__ */ t(
        E,
        {
          eventType: p,
          slug: e.slug,
          disabled: d,
          getAppData: a,
          setAppData: m
        }
      )
    }
  );
};
export {
  q as default
};
