feat: make /unternehmen hero image admin-editable too
Same gap as /imkerei and /herkunft (previous commit): last remaining hardcoded PlaceholderImage in the app, now wired to the same content-registry "pages" group / ContentImage pattern. Verified: tsc clean, 151/151 tests pass, page still returns 200. Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
1 parent
8d988515f3
commit
398db5c5ec
2 files changed
+13
-3
No files matched your search
@@ -1,9 +1,10 @@
|
|||||||
import type { Metadata } from "next";
|
import type { Metadata } from "next";
|
||||||
import { Container, SectionHeading } from "@/components/ui";
|
import { Container, SectionHeading } from "@/components/ui";
|
||||||
import { PlaceholderImage } from "@/components/placeholder-image";
|
import { ContentImage } from "@/components/content-image";
|
||||||
import { BusinessInquiryForm } from "@/components/business-inquiry-form";
|
import { BusinessInquiryForm } from "@/components/business-inquiry-form";
|
||||||
import { getLocale } from "@/i18n/locale";
|
import { getLocale } from "@/i18n/locale";
|
||||||
import { getDictionary } from "@/i18n/get-dictionary";
|
import { getDictionary } from "@/i18n/get-dictionary";
|
||||||
|
import { getContentValue } from "@/lib/content";
|
||||||
|
|
||||||
export async function generateMetadata(): Promise<Metadata> {
|
export async function generateMetadata(): Promise<Metadata> {
|
||||||
const t = getDictionary(await getLocale());
|
const t = getDictionary(await getLocale());
|
||||||
@@ -15,10 +16,18 @@ export async function generateMetadata(): Promise<Metadata> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default async function UnternehmenPage() {
|
export default async function UnternehmenPage() {
|
||||||
const t = getDictionary(await getLocale());
|
const locale = await getLocale();
|
||||||
|
const t = getDictionary(locale);
|
||||||
|
const image = await getContentValue("unternehmen.image", locale);
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<PlaceholderImage tone="honey" className="h-[45vh] min-h-[320px] w-full" label={t.unternehmenPage.eyebrow} />
|
<ContentImage
|
||||||
|
src={image || null}
|
||||||
|
alt={t.unternehmenPage.eyebrow}
|
||||||
|
tone="honey"
|
||||||
|
className="h-[45vh] min-h-[320px] w-full"
|
||||||
|
label={t.unternehmenPage.eyebrow}
|
||||||
|
/>
|
||||||
<Container className="py-20">
|
<Container className="py-20">
|
||||||
<SectionHeading
|
<SectionHeading
|
||||||
level="h1"
|
level="h1"
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ export const CONTENT_REGISTRY: ContentFieldDef[] = [
|
|||||||
// --- Weitere Seiten (nicht lokalisiert) ---
|
// --- Weitere Seiten (nicht lokalisiert) ---
|
||||||
{ key: "imkerei.image", group: "pages", labelDe: "Imkerei-Seite: Bild", labelEn: "Imkerei page: Image", type: "image", localized: false, getDefault: () => "" },
|
{ key: "imkerei.image", group: "pages", labelDe: "Imkerei-Seite: Bild", labelEn: "Imkerei page: Image", type: "image", localized: false, getDefault: () => "" },
|
||||||
{ key: "herkunft.image", group: "pages", labelDe: "Herkunft-Seite: Bild", labelEn: "Herkunft page: Image", type: "image", localized: false, getDefault: () => "" },
|
{ key: "herkunft.image", group: "pages", labelDe: "Herkunft-Seite: Bild", labelEn: "Herkunft page: Image", type: "image", localized: false, getDefault: () => "" },
|
||||||
|
{ key: "unternehmen.image", group: "pages", labelDe: "Geschäftskunden-Seite: Bild", labelEn: "Business page: Image", type: "image", localized: false, getDefault: () => "" },
|
||||||
|
|
||||||
// --- Social Media (nicht lokalisiert, leer = Icon wird im Footer nicht
|
// --- Social Media (nicht lokalisiert, leer = Icon wird im Footer nicht
|
||||||
// angezeigt, siehe components/site-footer.tsx Footer()) ---
|
// angezeigt, siehe components/site-footer.tsx Footer()) ---
|
||||||
|
|||||||
Reference in new issue
Block a user