19 lines
454 B
TypeScript
19 lines
454 B
TypeScript
import type { Prisma } from "../generated/prisma/client"
|
|
|
|
type PostWithPet = Prisma.PostGetPayload<{
|
|
include: { pet: true }
|
|
}>;
|
|
|
|
interface PostProps {
|
|
postData: PostWithPet;
|
|
}
|
|
|
|
export default async function Post({ postData }: PostProps) {
|
|
return <>
|
|
<h1>{postData.petId}</h1>
|
|
<p>{postData.content}</p>
|
|
<br/>
|
|
<p>Posted by a: <b>{postData.pet.species}</b> called <b>{postData.pet.name}</b></p>
|
|
<hr/>
|
|
</>
|
|
} |