import { aX as b, aY as f, aZ as E, a_ as x, aW as p, a$ as y } from "./index-6jcTChn4.js";
import { useState as C } from "react";
import { A as P } from "./AppCard-YGWCah1h.js";
import { u as g } from "./useIsAppEnabled-i8k_pVtm.js";
import v from "./EventTypeAppSettingsInterface-pDOF3Wsh.js";
const D = function({
  app: t,
  eventType: e,
  eventTypeFormMetadata: o
}) {
  var n;
  const { t: i } = b(), r = f.usePathname(), { getAppData: a, setAppData: c, disabled: d } = E(), { enabled: m, updateEnabled: l } = g(t), u = x(o), [h] = C(a("enabled")), s = !h && u;
  return /* @__PURE__ */ p.jsx(
    P,
    {
      returnTo: `${y}${r}?tabName=apps`,
      app: t,
      switchChecked: m,
      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__ */ p.jsx(
        v,
        {
          eventType: e,
          slug: t.slug,
          disabled: d,
          getAppData: a,
          setAppData: c
        }
      )
    }
  );
};
export {
  D as default
};
