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