import { jsx, jsxs } from "react/jsx-runtime";
import { useRef } from "react";
import { Layout } from "antd";
import { useParams } from "react-router-dom";
import { CurrentUser, PinnedPluginList, useApp, useSystemSettings } from "../../index.mjs";
import { AdminContent } from "./AdminContent.mjs";
import { AdminTabs } from "./AdminTabs.mjs";
import { MenuEditor } from "./MenuEditor.mjs";
import { useStyles } from "./style.mjs";
const InternalAdminLayout = (props)=>{
    var _result_data_data_logo, _result_data_data, _result_data, _result_data_data1, _result_data1;
    const sideMenuRef = useRef();
    const result = useSystemSettings();
    const app = useApp();
    const params = useParams();
    const { styles } = useStyles();
    return /*#__PURE__*/ jsxs(Layout, {
        className: styles.layout,
        children: [
            /*#__PURE__*/ jsx(Layout.Header, {
                className: styles.header,
                children: /*#__PURE__*/ jsxs("div", {
                    className: styles.headerA,
                    children: [
                        /*#__PURE__*/ jsxs("div", {
                            className: styles.headerB,
                            children: [
                                /*#__PURE__*/ jsxs("div", {
                                    className: styles.titleContainer,
                                    onClick: ()=>{
                                        location.href = app.adminUrl;
                                    },
                                    children: [
                                        /*#__PURE__*/ jsx("img", {
                                            className: styles.logo,
                                            src: null == result ? void 0 : null == (_result_data = result.data) ? void 0 : null == (_result_data_data = _result_data.data) ? void 0 : null == (_result_data_data_logo = _result_data_data.logo) ? void 0 : _result_data_data_logo.url
                                        }),
                                        /*#__PURE__*/ jsx("h1", {
                                            className: styles.title,
                                            children: null == result ? void 0 : null == (_result_data1 = result.data) ? void 0 : null == (_result_data_data1 = _result_data1.data) ? void 0 : _result_data_data1.title
                                        })
                                    ]
                                }),
                                /*#__PURE__*/ jsx(MenuEditor, {
                                    sideMenuRef: sideMenuRef
                                }),
                                /*#__PURE__*/ jsx("div", {
                                    className: styles.headerTabs,
                                    children: /*#__PURE__*/ jsx(AdminTabs, {})
                                })
                            ]
                        }),
                        /*#__PURE__*/ jsxs("div", {
                            className: styles.right,
                            children: [
                                /*#__PURE__*/ jsx(PinnedPluginList, {
                                    belongToFilter: "pinnedmenu"
                                }),
                                /*#__PURE__*/ jsx(CurrentUser, {})
                            ]
                        })
                    ]
                })
            }),
            /*#__PURE__*/ jsxs(Layout, {
                children: [
                    params.name && /*#__PURE__*/ jsx(Layout.Sider, {
                        className: styles.sider,
                        theme: 'light',
                        ref: sideMenuRef
                    }),
                    /*#__PURE__*/ jsx(Layout.Content, {
                        className: styles.main,
                        children: /*#__PURE__*/ jsx("div", {
                            className: "amplifier-block",
                            children: /*#__PURE__*/ jsx(AdminContent, {})
                        })
                    })
                ]
            })
        ]
    });
};
export { InternalAdminLayout };
