import type { Metadata } from 'next'
import { notFound, redirect } from 'next/navigation'
import { Suspense } from 'react'
import AutomationWorkflowsDashboard from '@/components/department-dashboard/AutomationWorkflowsDashboard'
import PermissionsDashboard from '@/components/department-dashboard/PermissionsDashboard'
import BrandHealthDashboard from '@/components/department-dashboard/BrandHealthDashboard'
import BusinessTrendsDashboard from '@/components/department-dashboard/BusinessTrendsDashboard'
import TeamCapacityDashboard from '@/components/department-dashboard/TeamCapacityDashboard'
import CoreMetricsDashboard from '@/components/department-dashboard/CoreMetricsDashboard'
import DepartmentShell from '@/components/department-dashboard/DepartmentShell'
import OrganizationStructureDashboard from '@/components/department-dashboard/OrganizationStructureDashboard'
import TeamFunctionsDashboard from '@/components/department-dashboard/TeamFunctionsDashboard'
import ValueMetricsDashboard from '@/components/department-dashboard/ValueMetricsDashboard'
import BrandKnowledgeDashboard from '@/components/department-dashboard/BrandKnowledgeDashboard'
import PerformanceConversionDashboard from '@/components/department-dashboard/PerformanceConversionDashboard'
import WorkspacePlaceholder from '@/components/department-dashboard/WorkspacePlaceholder'
import {
getFrameworkWorkspaceParams,
getWorkspaceItem,
WORKSPACE_REDIRECTS,
} from '@/components/department-dashboard/workspace-navigation'
type WorkspaceItemPageProps = {
params: {
section: string
item: string
}
searchParams?: { view?: string; scope?: string }
}
function AutomationWorkflowsFallback() {
return (
)
}
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.section.key === 'governance' && workspace.item.key === 'permissions') {
return {
title: '权限管理 | 治理与设置 | 品牌中心部门看板',
description: '集中配置权限组与查看人员的权限组归属。',
}
}
if (workspace.section.key === 'organization' && workspace.item.key === 'organization-structure') {
return {
title: '组织架构 | 组织管理 | 品牌中心部门看板',
description: '按品牌中心或全公司范围查看花名册组织层级与人员明细。',
}
}
if (workspace.section.key === 'organization' && workspace.item.key === 'team-functions') {
return {
title: '团队职能 | 组织管理 | 品牌中心部门看板',
description: '按团队查看品牌服务、前置能力、岗位与职责边界。',
}
}
if (workspace.section.key === 'assets' && workspace.item.key === 'value-metrics') {
return {
title: '价值指标 | 资产与AI自动化 | 品牌中心部门看板',
description: '从素材资产库按资产类型查看复用率与下载次数明细。',
}
}
if (workspace.section.key === 'assets' && workspace.item.key === 'brand-knowledge') {
return {
title: '品牌知识库 | 资产与AI自动化 | 品牌中心部门看板',
description: '按素材资产库的浏览方式检索和分类查看品牌知识。',
}
}
if (workspace.section.key === 'business' && workspace.item.key === 'performance-conversion') {
return {
title: '业绩转化 | 业务经营 | 品牌中心部门看板',
description: '按六个品牌关联已完结美术流程商品 ID,查看流程完结后六个月的每日经营变化。',
}
}
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.section.key === 'dashboard' && workspace.item.key === 'team-capacity'
? '按二级部门查看团队近八周收到与完结流程,并下钻查看每周任务明细。'
: `${workspace.item.title}二级页面框架。`,
}
}
export default function WorkspaceItemPage({ params, searchParams }: WorkspaceItemPageProps) {
const legacyTarget = WORKSPACE_REDIRECTS[`${params.section}/${params.item}`]
if (legacyTarget) redirect(legacyTarget)
const workspace = getWorkspaceItem(params.section, params.item)
if (!workspace) {
notFound()
}
if (workspace.section.key === 'assets' && workspace.item.key === 'automation-workflows') {
return (
}>
)
}
if (workspace.section.key === 'organization' && workspace.item.key === 'organization-structure') {
return
}
if (workspace.section.key === 'organization' && workspace.item.key === 'team-functions') {
return
}
if (workspace.section.key === 'assets' && workspace.item.key === 'value-metrics') {
return
}
if (workspace.section.key === 'assets' && workspace.item.key === 'brand-knowledge') {
return
}
if (workspace.section.key === 'business' && workspace.item.key === 'performance-conversion') {
return
}
if (workspace.section.key === 'governance' && workspace.item.key === 'permissions') {
return
}
if (workspace.item.status !== 'framework') notFound()
if (workspace.section.key === 'dashboard' && workspace.item.key === 'core-metrics') {
return
}
if (workspace.section.key === 'dashboard' && workspace.item.key === 'brand-health') {
return
}
if (workspace.section.key === 'dashboard' && workspace.item.key === 'business-trends') {
return
}
if (workspace.section.key === 'dashboard' && workspace.item.key === 'team-capacity') {
return
}
return (
)
}