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