Files
Arkie-Library-Frontend/src/components/messageStream/utils/postText.ts
2026-05-26 12:07:13 +08:00

14 lines
357 B
TypeScript

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() ||
""
);
}