CoastalCommitsPastes/client/app/(posts)/new/from/[id]/page.tsx

29 lines
513 B
TypeScript
Raw Normal View History

2022-11-12 04:28:06 -05:00
import NewPost from "../../components/new"
import { notFound } from "next/navigation"
2022-11-12 04:28:06 -05:00
import { getPostById } from "@lib/server/prisma"
import PageWrapper from "@components/page-wrapper"
2022-11-10 02:11:36 -05:00
const NewFromExisting = async ({
params
}: {
params: {
id: string
}
}) => {
const { id } = params
if (!id) {
return notFound()
}
2022-11-12 04:28:06 -05:00
const post = await getPostById(id, true)
return (
<PageWrapper signedIn>
<NewPost initialPost={post} newPostParent={id} />
</PageWrapper>
)
2022-11-09 21:38:05 -05:00
}
export default NewFromExisting