import { jsx, jsxs } from "react/jsx-runtime";
import "react";
import { css } from "@emotion/css";
import { Button, Card, Flex, Space, Typography } from "antd";
import { useTranslation } from "react-i18next";
import { useNavigate } from "react-router-dom";
import { useAPIClient, useRequest } from "../../../api-client/index.mjs";
import { createDesignable, useDesignable } from "../../../schema-component/index.mjs";
import { AddNewButtonComponent } from "./AddNewButton.mjs";
function _tagged_template_literal(strings, raw) {
    if (!raw) raw = strings.slice(0);
    return Object.freeze(Object.defineProperties(strings, {
        raw: {
            value: Object.freeze(raw)
        }
    }));
}
function _templateObject() {
    const data = _tagged_template_literal([
        "\n        max-width: 800px;\n        margin: 24px auto;\n      "
    ]);
    _templateObject = function() {
        return data;
    };
    return data;
}
function _templateObject1() {
    const data = _tagged_template_literal([
        "\n          margin-top: 48px;\n        "
    ]);
    _templateObject1 = function() {
        return data;
    };
    return data;
}
const WelcomeCard = ()=>{
    const { refresh } = useDesignable();
    const { t } = useTranslation();
    const navigate = useNavigate();
    const api = useAPIClient();
    const { data: schema } = useRequest({
        url: "/uiSchemas:getJsonSchema/default-admin-menu"
    });
    createDesignable({
        t,
        api,
        refresh,
        current: null == schema ? void 0 : schema.data
    });
    const navigatePlugin = ()=>navigate('/_admin/system-services/plugin-manager');
    const openHomePage = ()=>window.open('https://tachybase.org', '_blank');
    return /*#__PURE__*/ jsxs(Card, {
        className: css(_templateObject()),
        children: [
            /*#__PURE__*/ jsx(Typography.Title, {
                children: t('Welcome to the Tachy Platform!')
            }),
            /*#__PURE__*/ jsx(Typography.Text, {
                children: t('The Tachy Platform is dedicated to creating a user-friendly application development environment, aiming to lower development barriers, enhance efficiency, and provide enterprise users and developers with one-stop solutions.')
            }),
            /*#__PURE__*/ jsx(Flex, {
                justify: "flex-end",
                className: css(_templateObject1()),
                children: /*#__PURE__*/ jsxs(Space, {
                    children: [
                        /*#__PURE__*/ jsx(Button, {
                            onClick: openHomePage,
                            children: t('Official Website')
                        }),
                        /*#__PURE__*/ jsx(Button, {
                            onClick: navigatePlugin,
                            children: t('Plugin Management')
                        }),
                        /*#__PURE__*/ jsx(AddNewButtonComponent, {})
                    ]
                })
            })
        ]
    });
};
export { WelcomeCard };
