feat: wire public posts api

This commit is contained in:
TerryM
2026-05-26 12:07:13 +08:00
parent f482a2ec38
commit d3c30795dc
19 changed files with 299 additions and 163 deletions

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