Skip to content

Commit

Permalink
feat(apps/web/app/thought/edit/page): show edit thought modal
Browse files Browse the repository at this point in the history
  • Loading branch information
Mnigos committed Oct 3, 2024
1 parent 568cf0f commit 0f99425
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions apps/web/app/thought/[id]/edit/page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
export default function EditThoughtPage() {
return null
import {
Card,
CardHeader,
CardTitle,
CardContent,
} from '@repo/ui/components/card'

import type { EditThoughtPageProps } from '~/app/types/props'
import { ThoughtForm } from '~/components/thoughts'
import { getThoughtById } from '~/server/actions/thoughts'

export default async function EditThoughtPage({
params,
}: EditThoughtPageProps) {
const thought = await getThoughtById(params.id)

return (
<main className="flex min-h-screen items-center justify-center">
<Card className="flex w-full flex-col gap-8 p-4 md:w-[512px]">
<CardHeader>
<CardTitle className="text-center">Edit thought</CardTitle>
</CardHeader>

<CardContent>
<ThoughtForm thought={thought} />
</CardContent>
</Card>
</main>
)
}

0 comments on commit 0f99425

Please sign in to comment.