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-_1f6rhg6.js";
import { useState as P } from "react";
import { A as g } from "./AppCard-vvom7JzI.js";
import { u as v } from "./useIsAppEnabled-EWMW2qIQ.js";
import w from "./EventTypeAppSettingsInterface-eJdqCSck.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
};
