import LoginState from "@/app/_ui/LoginState";
import SiderNav from "../../_ui/SiderNav";
import { faAd, faMagnet, faPenClip, faSearch } from "@fortawesome/free-solid-svg-icons"
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
import { AntdRegistry } from '@ant-design/nextjs-registry';
export default function Layout({
    children,
}: Readonly<{
    children: React.ReactNode;
}>) {


    return (
        <div className="flex flex-col pl-[220px]">
            <SiderNav
                linkList={[
                    {
                        label: '链接管理',
                        iconElement: <FontAwesomeIcon icon={faMagnet} className=" fa-fw"></FontAwesomeIcon>,
                        _id: 'addLink',
                        href: '/admin/dashboard'
                    },
                    {
                        label: '搜索管理',
                        iconElement: <FontAwesomeIcon icon={faSearch}></FontAwesomeIcon>,
                        _id: 'searchMenagement',
                        href: '/admin/dashboard/search'
                    },
                    {
                        label: '广告管理',
                        iconElement: <FontAwesomeIcon icon={faAd}></FontAwesomeIcon>,
                        _id: 'adMenagement',
                        href: '/admin/dashboard/ad'

                    },
                    {
                        label: '文章管理',
                        iconElement: <FontAwesomeIcon icon={faPenClip}></FontAwesomeIcon>,
                        _id: 'articleMenagement',
                        href: '/admin/dashboard/article'

                    },

                ]}></SiderNav>
            <div>
                <div className="h-[50px] bg-white/80 shadow flex items-center justify-between px-5 ">
                    <span className="font-bold text-xl">后台管理面板</span>

                    <LoginState></LoginState>
                </div>
                <main className="p-2">
                    <AntdRegistry>
                        {children}
                    </AntdRegistry>
                </main>

            </div>
        </div>

    );
}
