const { useState, useRef } = React; // ───────────────────────────────────────────── // HILFSFUNKTIONEN // ───────────────────────────────────────────── function formatDateDE(dateStr) { if (!dateStr) return ''; const [y, m, d] = dateStr.split('-'); return `${d}.${m}.${y}`; } // ───────────────────────────────────────────── // HEADER // ───────────────────────────────────────────── function Header() { return (
✈️

TravelDesk

Intelligente Reiseplanung für Ihr Team

); } // ───────────────────────────────────────────── // LADEANIMATION // ───────────────────────────────────────────── const LOADING_STEPS = [ { icon: '📍', text: 'Fabrikadresse wird ermittelt...' }, { icon: '✈️', text: 'Flug-Link wird vorbereitet...' }, { icon: '🏨', text: 'Hotel-Link wird vorbereitet...' }, { icon: '🚗', text: 'Mietwagen wird geprüft...' }, ]; function LoadingState({ currentStep }) { return (
{LOADING_STEPS.map((step, i) => (
{step.icon} {step.text} {i < currentStep && }
))}
); } // ───────────────────────────────────────────── // EINGABE-FORMULAR // ───────────────────────────────────────────── function SearchForm({ onSearch, loading }) { const today = new Date().toISOString().split('T')[0]; const nextWeek = new Date(Date.now() + 7 * 86400000).toISOString().split('T')[0]; const nextWeek5 = new Date(Date.now() + 12 * 86400000).toISOString().split('T')[0]; const [form, setForm] = useState({ origin: 'Stuttgart, Deutschland', destStreet: '', destHouseNumber: '', destPostalCode: '', destCity: '', destCountry: '', checkin: nextWeek, checkout: nextWeek5, adults: 1, refundableOnly: true, directFlightsOnly: false, hotelAddress: '', specialRequirements: '', }); const set = (field) => (e) => { const val = e.target.type === 'checkbox' ? e.target.checked : e.target.type === 'number' ? parseInt(e.target.value) : e.target.value; setForm((prev) => ({ ...prev, [field]: val })); }; const handleSubmit = (e) => { e.preventDefault(); if (!form.destCity.trim()) { alert('Bitte gib mindestens die Zielstadt ein.'); return; } onSearch(form); }; return (

Neue Reise planen

{/* Zeile 1: Abflugort */}
{/* Zeile 2: Fabrikadresse */}
{/* Zeile 2 */}
{/* Zeile 3 */}