import { jsx as _jsx } from "react/jsx-runtime";
import { About, ConnectPackageManager, DangerZone, DefaultEditor, } from "@powerhousedao/connect/components";
import { Icon } from "@powerhousedao/design-system";
import { SettingsModal as SettingsModalV2 } from "@powerhousedao/design-system/connect";
import { closePHModal, usePHModal } from "@powerhousedao/reactor-browser";
import { t } from "i18next";
import React, { useMemo } from "react";
export const SettingsModal = () => {
    const phModal = usePHModal();
    const open = phModal?.type === "settings";
    function onRefresh() {
        window.location.reload();
    }
    const tabs = useMemo(() => [
        {
            id: "package-manager",
            icon: _jsx(Icon, { name: "PackageManager", size: 12 }),
            label: "Package Manager",
            content: ConnectPackageManager,
        },
        {
            id: "default-editors",
            icon: _jsx(Icon, { name: "Edit", size: 12 }),
            label: "Default Editors",
            content: DefaultEditor,
        },
        {
            id: "danger-zone",
            icon: _jsx(Icon, { name: "Danger", size: 12, className: "text-red-900" }),
            label: _jsx("span", { className: "text-red-900", children: "Danger Zone" }),
            content: () => _jsx(DangerZone, {}),
        },
        {
            id: "about",
            icon: _jsx(Icon, { name: "QuestionSquare", size: 12 }),
            label: "About",
            content: About,
        },
    ], [onRefresh]);
    return (_jsx(SettingsModalV2, { open: open, title: t("modals.connectSettings.title"), onOpenChange: (status) => {
            if (!status)
                return closePHModal();
        }, tabs: tabs }));
};
//# sourceMappingURL=SettingsModal.js.map