import type { SceneGraph } from '@pascal-app/editor' import { headers } from 'next/headers' import Link from 'next/link' import { SceneLoader, type SceneMeta } from '@/components/scene-loader' import { getPascalHostIdentity } from '@/lib/pascal-host-identity' import { getSceneOperations } from '@/lib/scene-store-server' export const dynamic = 'force-dynamic' interface SceneWithGraph extends SceneMeta { graph: SceneGraph } async function fetchScene(id: string): Promise { const identity = getPascalHostIdentity(await headers()) if (!identity.allowed) return null const operations = await getSceneOperations() const scene = await operations.loadStoredScene(id) if (!scene || (identity.userId && scene.ownerId !== identity.userId)) return null return scene as SceneWithGraph } export default async function ScenePage({ params }: { params: Promise<{ id: string }> }) { const { id } = await params const scene = await fetchScene(id) if (!scene) { return (

404

未找到场景

无法找到 ID 为 {id} 的场景。

查看场景 返回编辑器
) } const { graph, ...meta } = scene return }