"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const jsx_runtime_1 = require("react/jsx-runtime");
/*
 *  This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
 *  License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
 */
const antd_1 = require("antd");
function GoogleSearch() {
    return ((0, jsx_runtime_1.jsx)(antd_1.Input.Search, { size: "small", placeholder: "Search...", allowClear: true, enterButton: "Google", onSearch: (value) => {
            const host = window.location.host;
            const url = `https://www.google.com/search?q=site%3A${host}+${value}`;
            // Open url in a new tab.
            const tab = window.open(url, "_blank");
            if (tab != null) {
                tab.opener = null;
            }
        } }));
}
exports.default = GoogleSearch;
//# sourceMappingURL=google-search.js.map