-
Notifications
You must be signed in to change notification settings - Fork 1
/
common.types.ts
61 lines (58 loc) · 1.21 KB
/
common.types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import { Session, User } from "next-auth";
export type PostProps = {
_id: string;
user: {
image: string;
name: string;
username: string;
_id: string
};
createdAt: string;
updatedAt: string;
desc: string;
image: string;
comments: CommentProp[];
noOfLikes: number;
likesUser: string[];
tags: string[];
};
export type SessionType = {
id?: string | null;
name?: string | null;
email?: string | null;
image?: string | null;
bannerImage?: string;
username?: string;
tags?: string[];
bio?: string;
expires: string;
};
export type PostCardProps = {
key: number;
post: PostProps;
fetchPosts: () => void;
setIsEditing: React.Dispatch<React.SetStateAction<boolean>>;
setPostToEdit: React.Dispatch<React.SetStateAction<PostProps | null>>;
setOpenModal: React.Dispatch<React.SetStateAction<boolean>>;
};
export type CommentProp = {
creator: string | null | undefined;
desc: string;
post: string;
};
export type SingleCommentProps = {
createdAt: string;
creator: {
_id: string;
name: string;
username: string;
email: string;
bio: string;
image: string;
};
desc: string;
post: string;
updatedAt: string;
__v: number;
_id: string;
};