fix: useState Hooks vor Early Return verschieben

This commit is contained in:
2026-06-18 01:36:32 +02:00
parent fa68a9083b
commit f77c3c60d4

View File

@@ -45,6 +45,11 @@ function BestellungDetail({ id, toast, onBack }) {
const [pickerSearch,setPickerSearch]= useState('');
const [editMode, setEditMode] = useState(false);
const [form, setForm] = useState({ name:'', bemerkung:'', custom_price:'', status:'warteliste' });
const today = () => new Date().toISOString().slice(0,10);
const [bezahltDate, setBezahltDate] = useState(today());
const [abgeholtDate, setAbgeholtDate] = useState(today());
const [showBezahltPicker, setShowBezahltPicker] = useState(false);
const [showAbgeholtPicker, setShowAbgeholtPicker] = useState(false);
useEffect(() => {
api('/tools/kalkulator3d').then(d => setArchiv(d.own || d || [])).catch(()=>{});
@@ -124,12 +129,6 @@ function BestellungDetail({ id, toast, onBack }) {
return 'warteliste';
};
const today = () => new Date().toISOString().slice(0,10);
const [bezahltDate, setBezahltDate] = useState(today());
const [abgeholtDate, setAbgeholtDate] = useState(today());
const [showBezahltPicker, setShowBezahltPicker] = useState(false);
const [showAbgeholtPicker, setShowAbgeholtPicker] = useState(false);
function toggleBezahlt() {
if (!order.bezahlt) {
// Noch nicht bezahlt → Datum-Picker anzeigen