import { aL as b, aM as f, aN as E, aO as P, aK as p, aP as y } from "./index-GTnBs7av.js";
import { useState as x } from "react";
import { A as C } from "./AppCard-Q28K7Yaw.js";
import { u as g } from "./useIsAppEnabled-7UywjsU4.js";
import v from "./EventTypeAppSettingsInterface-31eIcGQA.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 = P(o), [h, S] = x(a("enabled")), s = !h && u;
  return /* @__PURE__ */ p.jsx(
    C,
    {
      returnTo: `${y}${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
};
