"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const jsx_runtime_1 = require("react/jsx-runtime");
const antd_1 = require("antd");
const icon_1 = require("@cocalc/frontend/components/icon");
const post_1 = __importDefault(require("lib/api/post"));
const router_1 = require("next/router");
const register_1 = __importDefault(require("../register"));
(0, register_1.default)({
    path: "account/sign-out",
    title: "Sign Out",
    icon: "sign-out-alt",
    desc: "Sign out of your account on this computer or everywhere.",
    Component: () => {
        const router = (0, router_1.useRouter)();
        return ((0, jsx_runtime_1.jsxs)(antd_1.Space, { direction: "vertical", children: ["Sign out of your account:", (0, jsx_runtime_1.jsxs)(antd_1.Button, { type: "primary", onClick: async () => {
                        await (0, post_1.default)("/accounts/sign-out", { all: false });
                        router.push("/");
                    }, children: [(0, jsx_runtime_1.jsx)(icon_1.Icon, { name: "sign-out-alt" }), " Sign Out"] }), (0, jsx_runtime_1.jsx)("br", {}), "Sign out on all devices that are authenticated:", (0, jsx_runtime_1.jsxs)(antd_1.Button, { onClick: async () => {
                        await (0, post_1.default)("/accounts/sign-out", { all: true });
                        router.push("/");
                    }, children: [(0, jsx_runtime_1.jsx)(icon_1.Icon, { name: "sign-out-alt" }), " Sign Out Everywhere"] })] }));
    },
});
//# sourceMappingURL=sign-out.js.map