-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(apps/web/app/thought/edit/page): show edit thought modal
- Loading branch information
Showing
1 changed file
with
29 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
) | ||
} |