43 lines
1.4 KiB
TypeScript
43 lines
1.4 KiB
TypeScript
import { AdSquares } from "@/components/common/ads";
|
|
import { SeoBreadcrumb } from "@/components/seo/seo-breadcrumb";
|
|
import type { HomePlayletResponse } from "@/lib/api/types";
|
|
|
|
import { FloatingActions } from "./floating-actions";
|
|
import { HeroBanner } from "./hero-banner";
|
|
import { HomeModules } from "./home-modules";
|
|
import { HomePageH5 } from "./home-page-h5";
|
|
import { NoticeMarquee } from "./notice-marquee";
|
|
import { DownloadBanner } from "./page-sections";
|
|
|
|
const HOME_H1_FALLBACK = "黄果黑料 - 热门短剧在线看";
|
|
|
|
export function HomePage({
|
|
home,
|
|
heading,
|
|
}: {
|
|
home?: HomePlayletResponse | null;
|
|
/** 与首页 TDK 对齐的主标题(H1) */
|
|
heading?: string | null;
|
|
}) {
|
|
const hasModules = Boolean(home?.modules?.some((module) => module.list?.length || module.topicList?.length));
|
|
const h1 = heading?.trim() || HOME_H1_FALLBACK;
|
|
|
|
return (
|
|
<>
|
|
<SeoBreadcrumb items={[{ name: "首页", href: "/" }]} />
|
|
<h1 className="sr-only">{h1}</h1>
|
|
<HomePageH5 home={home} />
|
|
<main data-component="home-page" className="design-frame hidden flex-col gap-8 pt-8 pb-10 lg:flex">
|
|
<HeroBanner banners={home?.homeBannerData} />
|
|
<NoticeMarquee items={home?.announcements} />
|
|
<AdSquares slot="BList" variant="pc" advitise={home?.advitise} />
|
|
|
|
{hasModules ? <HomeModules modules={home?.modules} /> : null}
|
|
|
|
<DownloadBanner />
|
|
</main>
|
|
<FloatingActions />
|
|
</>
|
|
);
|
|
}
|