import { getPubNewsletter } from "@/app/actions/NewsletterActions"; import { notFound } from "next/navigation"; export default async function NewsletterPage({ params }: { params: Promise<{ id: string }>; }) { // next passes in params object when this comp is called const { id } = await params; // [id] catches the value from the url and gives it a param value with the key of id const newsletter = await getPubNewsletter(id); if (!newsletter) { // otherwise tries to reference things that dont exist notFound(); } return (

{newsletter.title}

By {newsletter.author.name || "Unnamed author"}

{newsletter.imageUrl && ( {newsletter.title} )}
{newsletter.content}
); }