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