Refine CMS i18n fallback, refresh UI, add consent minimize, seed i18n content

Co-authored-by: dennis <dennis@konkol.net>
This commit is contained in:
Cursor Agent
2026-01-12 16:10:22 +00:00
parent 683735cc63
commit 6f1ad8eb4d
10 changed files with 244 additions and 81 deletions

View File

@@ -24,12 +24,18 @@ export default function PrivacyPolicy() {
`/api/content/page?key=${encodeURIComponent("privacy-policy")}&locale=${encodeURIComponent(locale)}`,
);
const data = await res.json();
if (data?.content?.content) {
// Only use CMS content if it exists for the active locale.
if (data?.content?.content && data?.content?.locale === locale) {
setCmsDoc(data.content.content as JSONContent);
setCmsTitle((data.content.title as string | null) ?? null);
} else {
setCmsDoc(null);
setCmsTitle(null);
}
} catch {
// ignore; fallback to static content
setCmsDoc(null);
setCmsTitle(null);
}
})();
}, [locale]);