82 lines
2.9 KiB
TypeScript
82 lines
2.9 KiB
TypeScript
import type { Metadata } from 'next'
|
|
import { notFound } from 'next/navigation'
|
|
import AutomationWorkflowsDashboard from '@/components/department-dashboard/AutomationWorkflowsDashboard'
|
|
import BrandHealthDashboard from '@/components/department-dashboard/BrandHealthDashboard'
|
|
import BusinessTrendsDashboard from '@/components/department-dashboard/BusinessTrendsDashboard'
|
|
import CoreMetricsDashboard from '@/components/department-dashboard/CoreMetricsDashboard'
|
|
import WorkspacePlaceholder from '@/components/department-dashboard/WorkspacePlaceholder'
|
|
import {
|
|
getFrameworkWorkspaceParams,
|
|
getWorkspaceItem,
|
|
} from '@/components/department-dashboard/workspace-navigation'
|
|
|
|
type WorkspaceItemPageProps = {
|
|
params: {
|
|
section: string
|
|
item: string
|
|
}
|
|
}
|
|
|
|
export function generateStaticParams() {
|
|
return getFrameworkWorkspaceParams()
|
|
}
|
|
|
|
export function generateMetadata({ params }: WorkspaceItemPageProps): Metadata {
|
|
const workspace = getWorkspaceItem(params.section, params.item)
|
|
if (!workspace) return {}
|
|
|
|
if (workspace.section.key === 'assets' && workspace.item.key === 'automation-workflows') {
|
|
return {
|
|
title: '自动化工作流 | 资产与AI自动化 | 品牌中心部门看板',
|
|
description: '集中进入绩效考核调研与作品过稿看板。',
|
|
}
|
|
}
|
|
|
|
if (workspace.item.status !== 'framework') return {}
|
|
|
|
return {
|
|
title: `${workspace.item.title} | ${workspace.section.title} | 品牌中心部门看板`,
|
|
description: workspace.section.key === 'dashboard' && workspace.item.key === 'brand-health'
|
|
? '六个品牌的健康度评分维度与权重框架。'
|
|
: workspace.section.key === 'dashboard' && workspace.item.key === 'business-trends'
|
|
? '六个品牌的近八周计划、实际完成量、项目结构与达成率框架。'
|
|
: `${workspace.item.title}二级页面框架。`,
|
|
}
|
|
}
|
|
|
|
export default function WorkspaceItemPage({ params }: WorkspaceItemPageProps) {
|
|
const workspace = getWorkspaceItem(params.section, params.item)
|
|
|
|
if (!workspace) {
|
|
notFound()
|
|
}
|
|
|
|
if (workspace.section.key === 'assets' && workspace.item.key === 'automation-workflows') {
|
|
return <AutomationWorkflowsDashboard />
|
|
}
|
|
|
|
if (workspace.item.status !== 'framework') notFound()
|
|
|
|
if (workspace.section.key === 'dashboard' && workspace.item.key === 'core-metrics') {
|
|
return <CoreMetricsDashboard />
|
|
}
|
|
|
|
if (workspace.section.key === 'dashboard' && workspace.item.key === 'brand-health') {
|
|
return <BrandHealthDashboard />
|
|
}
|
|
|
|
if (workspace.section.key === 'dashboard' && workspace.item.key === 'business-trends') {
|
|
return <BusinessTrendsDashboard />
|
|
}
|
|
|
|
return (
|
|
<WorkspacePlaceholder
|
|
title={workspace.item.title}
|
|
description={`“${workspace.item.title}”属于“${workspace.section.title}”板块,当前先建立独立二级页面框架。`}
|
|
accent={workspace.section.accent}
|
|
accentSoft={workspace.section.accentSoft}
|
|
accentText={workspace.section.accentText}
|
|
/>
|
|
)
|
|
}
|