feat: wire public posts api
This commit is contained in:
13
src/components/messageStream/utils/postText.ts
Normal file
13
src/components/messageStream/utils/postText.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { localizationKey } from "../../../i18nLanguages";
|
||||
import type { Post } from "../../../types/post";
|
||||
|
||||
export function postDisplayText(post: Post, lang: string): string {
|
||||
const key = localizationKey(lang);
|
||||
return (
|
||||
post.localizations?.[
|
||||
key as keyof typeof post.localizations
|
||||
]?.text?.trim() ||
|
||||
post.text?.trim() ||
|
||||
""
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user