import { headers } from 'next/headers' import Link from 'next/link' import { CreateSceneButton } from '@/components/save-button' import 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' async function fetchScenes(): Promise { const identity = getPascalHostIdentity(await headers()) if (!identity.allowed) return [] const operations = await getSceneOperations() return operations.listScenes({ limit: 50, ownerId: identity.userId ?? undefined }) } function formatDate(iso: string): string { try { return new Date(iso).toLocaleString('zh-CN', { hour12: false }) } catch { return iso } } export default async function ScenesPage() { const scenes = await fetchScenes() return (

我的场景

{scenes.length === 0 ? '还没有场景,创建一个开始设计吧。' : `共 ${scenes.length} 个场景`}

{scenes.length === 0 ? (

尚未保存任何场景。

) : (
    {scenes.map((scene) => (
  • {scene.thumbnailUrl ? ( // eslint-disable-next-line @next/next/no-img-element {scene.name} ) : ( 暂无缩略图 )}

    {scene.name}

    {scene.nodeCount} 个元素
  • ))}
)}
) }