fix: Chargen-Bild-Fallback pro Slot statt alles-oder-nichts

/charge/[code] zeigt zwei Bild-Slots (Produkt-/Standortfoto). Die
bisherige Logik ersetzte bei JEDEM eigenen Chargenfoto beide Slots
komplett durch batch.images — wer nur ein Chargenfoto pflegte, verlor
dadurch das zweite (Standort-)Bild der Ernte statt es weiter anzuzeigen.
Jeder Slot faellt jetzt einzeln auf das jeweilige Erntebild zurueck.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
Nick SzaunigandClaude Sonnet 5 committed 2026-09-12 18:39:43 +02:00
1 parent 7d5c172487
commit a52faea3ad
1 file changed
+8 -2
+8 -2
View File
@@ -40,8 +40,14 @@ export default async function BatchPage(props: PageProps<"/charge/[code]">) {
{ label: t.chargePage.stepBestBefore, value: formatDate(batch.bestBeforeDate, locale) },
];
// Eigene Chargenfotos (z.B. Etikett/Abfuellung dieser konkreten Charge)
// gehen vor, falls gepflegt — sonst wie bisher die Erntebilder.
const displayImages = batch.images.length > 0 ? batch.images : batch.harvest.images;
// gehen PRO Slot vor, falls gepflegt — sonst faellt genau dieser Slot auf
// das entsprechende Erntebild zurueck. Bewusst NICHT alles-oder-nichts:
// wer nur ein Chargenfoto pflegt, soll nicht das zweite (Standort-)Bild
// verlieren, nur weil die Charge kein zweites eigenes Foto hat.
const displayImages = [
batch.images[0] ?? batch.harvest.images[0] ?? null,
batch.images[1] ?? batch.harvest.images[1] ?? null,
];
return (
<div className="py-20">