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() } catch { return iso } } export default async function ScenesPage() { const scenes = await fetchScenes() return (

Your scenes

{scenes.length === 0 ? 'No scenes yet. Create one to get started.' : `${scenes.length} scene${scenes.length === 1 ? '' : 's'}.`}

{scenes.length === 0 ? (

You haven't saved any scenes yet.

) : (
    {scenes.map((scene) => (
  • {scene.thumbnailUrl ? ( // eslint-disable-next-line @next/next/no-img-element {scene.name} ) : ( No thumbnail )}

    {scene.name}

    {scene.nodeCount} nodes
  • ))}
)}
) }