- {' Posted by '} - - - Leanne Graham - -
-- est rerum tempore vitae sequi sint nihil reprehenderit dolor beatae ea - dolores neque fugiat blanditiis voluptate porro vel nihil molestiae ut - reiciendis qui aperiam non debitis possimus qui neque nisi nulla -
- -- {' Posted by '} - - - Patricia Lebsack - -
-- deserunt eos nobis asperiores et hic est debitis repellat molestiae - optio nihil ratione ut eos beatae quibusdam distinctio maiores earum - voluptates et aut adipisci ea maiores voluptas maxime -
- -{body}
+ ++ {' Posted by '} + + + {user?.name} + +
+ ); +}; diff --git a/src/types/Comment.ts b/src/types/Comment.ts new file mode 100644 index 0000000000..14df6303f3 --- /dev/null +++ b/src/types/Comment.ts @@ -0,0 +1,7 @@ +export interface Comment { + postId: number; + id: number; + name: string; + email: string; + body: string; +} diff --git a/src/types/Post.ts b/src/types/Post.ts new file mode 100644 index 0000000000..176e47e648 --- /dev/null +++ b/src/types/Post.ts @@ -0,0 +1,11 @@ +import { Comment } from './Comment'; +import { User } from './User'; + +export interface Post { + userId: number; + id: number; + title: string; + body: string; + user: User | null; + comments: Comment[] | null; +} diff --git a/src/types/User.ts b/src/types/User.ts new file mode 100644 index 0000000000..1f6908b55a --- /dev/null +++ b/src/types/User.ts @@ -0,0 +1,6 @@ +export interface User { + id: number; + name: string; + username: string; + email: string; +}