const require_runtime = require("../../../../_virtual/_rolldown/runtime.js");
const require_useEngineContext = require("../../../../hooks/useEngineContext.js");
const require_constants = require("./constants.js");
const require_locales = require("./locales.js");
let react = require("react");
react = require_runtime.__toESM(react);
let antd = require("antd");
let _pisell_utils = require("@pisell/utils");
let classnames = require("classnames");
classnames = require_runtime.__toESM(classnames);
require("./SettingList.less");
//#region src/components/authentication/admin/AuthMethods/SettingList.tsx
const SettingList = ({ className, style, methods: initialMethods, onToggle, onSettings, onConfigClick, enableSetting = true, renderTitle }) => {
	var _context$engine;
	const context = require_useEngineContext.default();
	_pisell_utils.locales.init(require_locales.default, (context === null || context === void 0 || (_context$engine = context.engine) === null || _context$engine === void 0 || (_context$engine = _context$engine.props) === null || _context$engine === void 0 ? void 0 : _context$engine.locale) || "en");
	const methods = initialMethods || require_constants.getDefaultAuthMethods();
	const handleSettings = (method) => {
		onSettings === null || onSettings === void 0 || onSettings(method);
	};
	const shouldShowSettings = (method) => {
		if (!enableSetting) return false;
		return true;
	};
	return /* @__PURE__ */ react.default.createElement("div", {
		className: (0, classnames.default)("setting-list", className),
		style
	}, methods.map((method) => /* @__PURE__ */ react.default.createElement("div", {
		key: method.id,
		className: "setting-list-item"
	}, /* @__PURE__ */ react.default.createElement("div", { className: "setting-list-item-icon" }, method.icon), /* @__PURE__ */ react.default.createElement("div", { className: "setting-list-item-content" }, /* @__PURE__ */ react.default.createElement("div", { className: "setting-list-item-title" }, renderTitle ? renderTitle(method) : method.title), /* @__PURE__ */ react.default.createElement("div", { className: "setting-list-item-description" }, method.description)), /* @__PURE__ */ react.default.createElement("div", { className: "setting-list-item-actions" }, shouldShowSettings(method) && /* @__PURE__ */ react.default.createElement(antd.Button, {
		type: "default",
		onClick: () => handleSettings(method)
	}, _pisell_utils.locales.getText("auth.button.settings"))))));
};
//#endregion
exports.default = SettingList;
