feat: add sorts to user pages

This commit is contained in:
Xyphyn committed 2023-07-27 12:25:26 -07:00
1 parent d427d4b2fc
commit c0aaf08a9f
12 files changed
+129 -69

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
import type {
CommentView,
CommunityView,
PersonView,
PostView,
} from 'lemmy-js-client'
export function getItemPublished(
item: PostView | CommentView | PersonView | CommunityView
) {
if ('comment' in item) {
return item.comment.published
} else if ('post' in item) {
return item.post.published
}
if ('person' in item) {
return item.person.published
}
if ('community' in item) {
return item.community.published
}
return ''
}