import { jsx as o } from "react/jsx-runtime";
import { y as b, G as f, J as y, K as E, W as P } from "./index-_1f6rhg6.js";
import { useState as C } from "react";
import { A as g } from "./AppCard-vvom7JzI.js";
import { u as v } from "./useIsAppEnabled-EWMW2qIQ.js";
import w from "./EventTypeAppSettingsInterface-4j95fNdX.js";
const q = function({
  app: e,
  eventType: t,
  eventTypeFormMetadata: p
}) {
  var n;
  const { t: i } = b(), r = f.usePathname(), { getAppData: a, setAppData: m, disabled: c } = y(), { enabled: d, updateEnabled: l } = v(e), u = E(p), [h, T] = C(a("enabled")), s = !h && u;
  return /* @__PURE__ */ o(
    g,
    {
      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__ */ o(
        w,
        {
          eventType: t,
          slug: e.slug,
          disabled: c,
          getAppData: a,
          setAppData: m
        }
      )
    }
  );
};
export {
  q as default
};
