import { jsx as p } from "react/jsx-runtime";
import { y as b, G as f, J as y, K as E, W as C } from "./index-ykl8OQ78.js";
import { useState as P } from "react";
import { A as g } from "./AppCard-cTyZ7qdO.js";
import { u as v } from "./useIsAppEnabled-jQTpW-EN.js";
import w from "./EventTypeAppSettingsInterface-CwuQI4XA.js";
const W = function({
  app: t,
  eventType: e,
  eventTypeFormMetadata: n
}) {
  var o;
  const { t: i } = b(), r = f.usePathname(), { getAppData: a, setAppData: c, disabled: m } = y(), { enabled: d, updateEnabled: l } = v(t), u = E(n), [h] = P(a("enabled")), s = !h && u;
  return /* @__PURE__ */ p(
    g,
    {
      returnTo: `${C}${r}?tabName=apps`,
      app: t,
      switchChecked: d,
      switchOnClick: (A) => {
        l(A);
      },
      teamId: ((o = e.team) == null ? void 0 : o.id) || void 0,
      disableSwitch: s,
      switchTooltip: s ? i("other_payment_app_enabled") : void 0,
      children: /* @__PURE__ */ p(
        w,
        {
          eventType: e,
          slug: t.slug,
          disabled: m,
          getAppData: a,
          setAppData: c
        }
      )
    }
  );
};
export {
  W as default
};
