import { jsx as _jsx } from "react/jsx-runtime";
import { resolve } from '../../../../lib/server-container.js';
import { PagesPanel } from '../../../../components/pm/page-editor/pages-panel.js';
/** Skip static pre-rendering since we need runtime DI container and server context. */
export const dynamic = 'force-dynamic';
export default async function ProjectPagesPage({ params }) {
    const { slug } = await params;
    const projectUseCase = resolve('GetPmProjectUseCase');
    const result = await projectUseCase.execute(slug);
    if (!result.ok) {
        return (_jsx("div", { className: "flex h-full items-center justify-center p-6", children: _jsx("p", { className: "text-muted-foreground text-sm", children: result.error }) }));
    }
    const project = result.project;
    const pagesUseCase = resolve('ListPagesUseCase');
    const pagesResult = await pagesUseCase.execute(project.id);
    return (_jsx("div", { className: "flex h-full flex-col", children: _jsx(PagesPanel, { projectId: project.id, pages: pagesResult.ok ? pagesResult.pages : [], className: "h-full" }) }));
}
