import { jsx as t, jsxs as m } from "react/jsx-runtime";
import { s as A, f as i } from "./index-T-3isYi5.js";
import { A as I } from "./AppCard-JgJMoBtw.js";
import { u as g } from "./useIsAppEnabled-SudDKIHz.js";
const D = function({
  app: a,
  eventType: p,
  onAppInstallSuccess: d
}) {
  var s;
  const { getAppData: r, setAppData: n, disabled: o } = A(), l = r("TRACKING_ID"), c = r("API_HOST"), { enabled: u, updateEnabled: h } = g(a);
  return /* @__PURE__ */ t(
    I,
    {
      onAppInstallSuccess: d,
      hideSettingsIcon: !0,
      app: a,
      switchOnClick: (e) => {
        h(e);
      },
      switchChecked: u,
      teamId: ((s = p.team) == null ? void 0 : s.id) || void 0,
      children: /* @__PURE__ */ m("div", { className: "flex flex-col gap-2", children: [
        /* @__PURE__ */ t(
          i,
          {
            required: !0,
            disabled: o,
            name: "Tracking ID",
            value: l,
            placeholder: "Enter your Tracking ID",
            onChange: (e) => {
              n("TRACKING_ID", e.target.value);
            }
          }
        ),
        /* @__PURE__ */ t(
          i,
          {
            required: !0,
            disabled: o,
            name: "Api host",
            value: c,
            placeholder: "Enter your Api host url",
            onChange: (e) => {
              n("API_HOST", e.target.value);
            }
          }
        )
      ] })
    }
  );
};
export {
  D as default
};
