From 52a77ad1ae43e439d2635e959192d8dff6f675f8 Mon Sep 17 00:00:00 2001 From: Dicken Date: Tue, 26 May 2026 12:53:36 +0200 Subject: [PATCH] Dateien nach "frontend/src/tools" hochladen --- frontend/src/tools/bestellungen.jsx | 90 +++++++++++++++++++++++++++-- 1 file changed, 85 insertions(+), 5 deletions(-) diff --git a/frontend/src/tools/bestellungen.jsx b/frontend/src/tools/bestellungen.jsx index bff5457..bc6c883 100644 --- a/frontend/src/tools/bestellungen.jsx +++ b/frontend/src/tools/bestellungen.jsx @@ -440,6 +440,75 @@ function BestellungDetail({ id, toast, onBack }) { ); } +// ── Archiv-Eintrag Modal ───────────────────────────────────────────────────── +function ArchivModal({ calcId, onClose }) { + const [item, setItem] = useState(null); + const [lightbox, setLightbox] = useState(false); + useEffect(() => { + api('/tools/kalkulator3d').then(items => { + setItem(items.find(i => i.id === calcId) || null); + }).catch(() => {}); + }, [calcId]); + + if (!item) return ( +
+
Lädt…
+
+ ); + + return ( +
e.target===e.currentTarget&&onClose()}> + {lightbox &&
setLightbox(false)}> + +
} +
+
+
+
+
{item.name}
+ +
+
+
+ {item.image && ( + {item.name}setLightbox(true)} + style={{width:'100%',maxHeight:180,objectFit:'cover',borderRadius:8,marginBottom:12, + cursor:'pointer',border:'1px solid rgba(255,255,255,0.1)'}}/> + )} +
+ {[['Gewicht',`${item.gramm}g`],['Dauer',`${item.stunden}h`],['Farben',item.farben]].map(([l,v])=>( +
+
{l.toUpperCase()}
+
{v}
+
+ ))} +
+
+ {[['💖',item.preis_freundschaft,'#ff6b9d'],['🤝',item.preis_normal,'#4ecdc4'],['💼',item.preis_auftrag,'#ffe66d']].map(([e,v,color])=>( +
+
{e}
+
{v.toFixed(2)}€
+
+ ))} +
+ {item.bemerkung && ( +
+
{item.bemerkung}
+
+ )} +
+
+
+ ); +} + // ── Übersicht ───────────────────────────────────────────────────────────────── export default function Bestellungen({ toast, mobile }) { const { confirm, ConfirmDialog } = useConfirm(); @@ -448,8 +517,8 @@ export default function Bestellungen({ toast, mobile }) { const [search, setSearch] = useState(''); const [filterStatus,setFilter] = useState('warteliste'); const [openId, setOpenId] = useState(null); - const [delId, setDelId] = useState(null); const [newMode, setNewMode] = useState(false); + const [archivItem, setArchivItem] = useState(null); const load = () => { setLoading(true); @@ -488,6 +557,7 @@ export default function Bestellungen({ toast, mobile }) { return (
+ {archivItem && setArchivItem(null)}/>}

Bestellungen

}
@@ -597,9 +667,19 @@ export default function Bestellungen({ toast, mobile }) { borderBottom:'1px solid rgba(255,255,255,0.04)'}}> {/* Status dot */} - {/* Name */} - {item.calc_name} + {/* Name – klickbar wenn calculation_id vorhanden */} + {item.calculation_id ? ( + + ) : ( + {item.calc_name} + )} {/* Stückzahl */} ×{item.stueckzahl}