CoastalCommitsPastes/client/app/(posts)/new/from/[id]/page.tsx
2022-11-12 18:39:03 -08:00

23 lines
412 B
TypeScript

import NewPost from "../../components/new"
import { notFound } from "next/navigation"
import { getPostById } from "@lib/server/prisma"
const NewFromExisting = async ({
params
}: {
params: {
id: string
}
}) => {
const { id } = params
if (!id) {
return notFound()
}
const post = await getPostById(id, true)
return <NewPost initialPost={post} newPostParent={id} />
}
export default NewFromExisting