MCPcopy
hub / github.com/shadcn-ui/taxonomy / EditorPage

Function EditorPage

app/(editor)/editor/[postId]/page.tsx:22–45  ·  view source on GitHub ↗
({ params }: EditorPageProps)

Source from the content-addressed store, hash-verified

20}
21
22export default async function EditorPage({ params }: EditorPageProps) {
23 const user = await getCurrentUser()
24
25 if (!user) {
26 redirect(authOptions?.pages?.signIn || "/login")
27 }
28
29 const post = await getPostForUser(params.postId, user.id)
30
31 if (!post) {
32 notFound()
33 }
34
35 return (
36 <Editor
37 post={{
38 id: post.id,
39 title: post.title,
40 content: post.content,
41 published: post.published,
42 }}
43 />
44 )
45}

Callers

nothing calls this directly

Calls 2

getCurrentUserFunction · 0.90
getPostForUserFunction · 0.85

Tested by

no test coverage detected