import db from "@/db";
export default async function PostPage({params}) {
try {
const post = await db.post.findUnique({
where: {
id: parseInt(params.id),
},
include: {
author: true,
}
});
} catch (error)
{
throw error;
}
return (
<div>
<h1>{post.title}</h1>
<p>{post.content}</p>
</div>
)
}
how i can return const with try? now its say that post is undefined