| 1 | /** |
| 2 | * 草稿箱页面 |
| 3 | * 独立页面展示 AI 批量生成 + 草稿列表 + 相关弹窗 |
| 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 | const { t } = await useTranslation(lng, 'common') |
| 20 | |
| 21 | return getMetadata( |
| 22 | { |
| 23 | title: t('header.draftBoxSeoTitle'), |
| 24 | description: t('header.draftBoxSeoDescription'), |
| 25 | keywords: t('header.draftBoxSeoKeywords'), |
| 26 | }, |
| 27 | lng, |
| 28 | '/draft-box', |
| 29 | ) |
| 30 | } |
| 31 | |
| 32 | const DraftBoxCore = dynamic(() => import('./DraftBoxCore'), { |
| 33 | ssr: false, |
| 34 | }) |
| 35 | |
| 36 | export default function DraftBoxPage() { |
| 37 | return <DraftBoxCore /> |
| 38 | } |
| 39 |