import { jsx as p } from "react/jsx-runtime";
import { q as b, s as f, t as E, v, W as y } from "./index-ZQlxzdt5.js";
import { useState as C } from "react";
import { A as P } from "./AppCard-cTGNOAHy.js";
import { u as g } from "./useIsAppEnabled-V8Jl9FX-.js";
import w from "./EventTypeAppSettingsInterface-N-387tFo.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 } = E(), { enabled: d, updateEnabled: l } = g(t), u = v(n), [h] = C(a("enabled")), s = !h && u;
  return /* @__PURE__ */ p(
    P,
    {
      returnTo: `${y}${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
};
