| 1 | /** |
| 2 | * 首页 - 内容管理 |
| 3 | * 开源版首页直接展示草稿箱内容管理核心能力。 |
| 4 | */ |
| 5 | |
| 6 | import dynamic from 'next/dynamic' |
| 7 | import { useTranslation } from '@/app/i18n' |
| 8 | import { fallbackLng, languages } from '@/app/i18n/languageConfig' |
| 9 | import { getMetadata } from '@/utils/metadata' |
| 10 | |
| 11 | interface PageParams { |
| 12 | params: Promise<{ lng: string }> |
| 13 | } |
| 14 | |
| 15 | export async function generateMetadata({ params }: PageParams) { |
| 16 | let { lng } = await params |
| 17 | if (!languages.includes(lng)) |
| 18 | lng = fallbackLng |
| 19 | |
| 20 | const { t } = await useTranslation(lng, 'common') |
| 21 | |
| 22 | return getMetadata( |
| 23 | { |
| 24 | title: t('header.draftBoxSeoTitle'), |
| 25 | description: t('header.draftBoxSeoDescription'), |
| 26 | keywords: t('header.draftBoxSeoKeywords'), |
| 27 | }, |
| 28 | lng, |
| 29 | '/', |
| 30 | ) |
| 31 | } |
| 32 | |
| 33 | const DraftBoxCore = dynamic(() => import('./draft-box/DraftBoxCore'), { |
| 34 | ssr: false, |
| 35 | }) |
| 36 | |
| 37 | export default function HomePage() { |
| 38 | return <DraftBoxCore /> |
| 39 | } |
| 40 |