import { jsx as _jsx } from "react/jsx-runtime";
import { resolve } from '../../../lib/server-container.js';
import { ProjectDetailClient } from '../../../components/features/projects/project-detail-client.js';
/** Skip static pre-rendering since we need runtime DI container and server context. */
export const dynamic = 'force-dynamic';
export default async function ProjectDetailPage({ 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 [workItems, states, labels, cycles, modules, epicsResult] = await Promise.all([
        resolve('ListWorkItemsUseCase').execute(project.id),
        resolve('ManageWorkItemStatesUseCase').list(project.id),
        resolve('ManageLabelsUseCase').list(project.id),
        resolve('ListCyclesUseCase').execute(project.id),
        resolve('ListModulesUseCase').execute(project.id),
        resolve('ListEpicsUseCase').execute(project.id),
    ]);
    return (_jsx("div", { className: "flex h-full flex-col p-6", children: _jsx(ProjectDetailClient, { project: project, workItems: workItems, states: states, labels: labels, cycles: cycles, modules: modules, epics: epicsResult.epics }) }));
}
