feat: add sorts to user pages
This commit is contained in:
1 parent
d427d4b2fc
commit
c0aaf08a9f
12 files changed
+129
-69
No files matched your search
@@ -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 ''
|
||||
}
|
||||
Reference in new issue
Block a user