import Box from "@/components/Box";
import Header from "@/components/Header";

import { getTranslations } from "next-intl/server";
import { FC, PropsWithChildren, ReactNode } from "react";
export const generateMetadata = async () => {
    const t = await getTranslations("titles");
    return {
        title: t("home"),
    };
};
type Props = {
    swiperWidget: ReactNode;
    popupWidget: ReactNode;
    cardWidget: ReactNode;
    noticeWidget: ReactNode;
    searchWidget: ReactNode;
    prizeWidget: ReactNode;
    actionWidget: ReactNode;
};
const Layout: FC<PropsWithChildren<Props>> = (props) => {
    const {
        children,
        swiperWidget,
        popupWidget,
        cardWidget,
        noticeWidget,
        searchWidget,
        prizeWidget,
        actionWidget,
    } = props;

    return (
        <>
            <Header></Header>
            <main id="maincontainer" className={"main-footer-header"}>
                {/*弹窗*/}
                {popupWidget}
                <Box>
                    {/* swiper */}
                    {swiperWidget}
                    {/* swiper下的活动 */}
                    {cardWidget}
                    {/* 跑马灯 */}
                    {noticeWidget}
                    {/* 搜索组件 */}
                    {searchWidget}
                    {/* 搜索下面的大奖展示 */}
                    {prizeWidget}
                </Box>
                {/* tabs 和 游戏列表 */}
                {children}
                {/*底部信息*/}
                {actionWidget}
            </main>
        </>
    );
};

export default Layout;
