-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpost.ts
More file actions
34 lines (31 loc) · 790 Bytes
/
post.ts
File metadata and controls
34 lines (31 loc) · 790 Bytes
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
type PostMedia = {
id: string
post_id: string
media_url: string
media_type: 'image' | 'video'
position: number
created_at: string
}
type Post = {
id: string
profile_id: string
caption: string | null
subtitle: string | null
grid_position: number
status: 'draft' | 'scheduled' | 'published'
scheduled_at: string | null
published_at: string | null
created_at: string
updated_at: string
/** Ordered by `position` ascending (normalized when loading from the server and when saving). */
media: PostMedia[]
}
// Local media item for form handling (before upload)
type LocalMediaItem = {
id: string
file?: File
url: string
type: 'image' | 'video'
isNew: boolean // true if file needs to be uploaded
}
export type { LocalMediaItem, Post, PostMedia }