import { Button as c, ButtonType as N, ButtonStyle as y } from "./accelbyte-widgets107.mjs";
import { Checkbox as p } from "./accelbyte-widgets335.mjs";
import s from "classnames";
import e from "react";
import { Trans as o } from "react-i18next";
const F = (l) => {
  const {
    icon: i,
    title: m,
    description: b,
    enabledFactors: t,
    checkBoxLabel: d,
    onClickCheckbox: E,
    isCheckboxDisabled: f,
    isFactorEnabled: a,
    onEnable: u,
    onDisable: x,
    FactorValue: r,
    isFirstSection: v
  } = l, n = l.isPreviewMode;
  return /* @__PURE__ */ e.createElement("div", { className: s("mb-4 flex items-center justify-between", v && "border-gray-70 border-b pb-4") }, /* @__PURE__ */ e.createElement("div", { className: "flex w-5/6 items-center" }, /* @__PURE__ */ e.createElement("div", { className: "mr-5" }, i), /* @__PURE__ */ e.createElement("div", { className: "w-3/4" }, /* @__PURE__ */ e.createElement("div", { className: "mb-2 flex items-center" }, /* @__PURE__ */ e.createElement("div", { className: "mr-3" }, m), /* @__PURE__ */ e.createElement(
    "div",
    {
      className: s(
        "flex items-center rounded-full px-3 py-0.5 text-sm text-[color:rgb(var(--od-rgba-text))]",
        a ? "bg-green-80 " : "bg-gray-55"
      )
    },
    a ? "On" : "Off"
  )), /* @__PURE__ */ e.createElement("div", { className: "mb-2 text-[color:rgb(var(--od-rgb-text),0.65)]" }, b), t && t.enabled.includes(r) && /* @__PURE__ */ e.createElement(
    p,
    {
      label: d,
      isChecked: t.default === r,
      isLabelFirst: !1,
      onChange: E,
      isDisabled: f
    }
  ))), /* @__PURE__ */ e.createElement("div", { className: "w-1/6" }, a ? /* @__PURE__ */ e.createElement(
    c,
    {
      className: "btn btn-ghost w-full",
      buttonType: N.TEXT,
      buttonStyle: y.NONE,
      onClick: n ? void 0 : x
    },
    /* @__PURE__ */ e.createElement(o, { i18nKey: "AccountPasswordSecurity.2fa.btnDisable" }, "Disable")
  ) : /* @__PURE__ */ e.createElement(c, { className: "btn btn-primary w-full", onClick: n ? void 0 : u }, /* @__PURE__ */ e.createElement(o, { i18nKey: "AccountPasswordSecurity.2fa.btnEnable" }, "Enable"))));
};
export {
  F as FactorSectionComponent
};
