Skip to content

Commit 91e0eed

Browse files
committed
deploy
1 parent 32c9882 commit 91e0eed

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

src/app/proyectos/[id]/page.tsx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,22 @@ import { notFound } from "next/navigation";
33
import ProjectPage from "@/components/project-page";
44
import { projects } from "@/components/projects";
55

6-
export default async function ProjectRoute({
6+
// ① Generamos estáticamente todas las rutas /proyectos/<id>
7+
export function generateStaticParams() {
8+
return projects.map((project) => ({
9+
id: project.id,
10+
}));
11+
}
12+
13+
// ② Página para cada proyecto
14+
export default function ProjectRoute({
715
params,
816
}: {
9-
params: Promise<{ id: string }>;
17+
params: { id: string };
1018
}) {
11-
// 1️⃣ Esperamos a que Next.js resuelva los params
12-
const { id } = await params;
13-
14-
// 2️⃣ Buscamos el proyecto
15-
const project = projects.find((p) => p.id === id);
19+
const project = projects.find((p) => p.id === params.id);
1620
if (!project) {
1721
return notFound();
1822
}
19-
20-
// 3️⃣ Devolvemos la UI
2123
return <ProjectPage project={project} />;
2224
}

0 commit comments

Comments
 (0)