/* Voyage Assistant — pages for the interactive prototype. Home, Results, Booking, Confirmation, MesBillets. Uses globals from voyage-icons.jsx + voyage-shared.jsx. */ /* ── Fake-QR generator (deterministic pseudo-random grid) ── */ const QRCode = ({ seed = 'TRV-2026-AX42K9', size = 120 }) => { const N = 21; // simple hash → 0/1 grid; finder patterns in 3 corners const cells = React.useMemo(() => { let h = 0; for (let i = 0; i < seed.length; i++) h = (h * 31 + seed.charCodeAt(i)) >>> 0; const rng = () => { h = (h * 1664525 + 1013904223) >>> 0; return h / 4294967295; }; const g = Array.from({ length: N }, () => Array.from({ length: N }, () => rng() > 0.52 ? 1 : 0)); // finder patterns const place = (r, c) => { for (let i = 0; i < 7; i++) for (let j = 0; j < 7; j++) g[r+i][c+j] = 0; for (let i = 0; i < 7; i++) { g[r][c+i] = 1; g[r+6][c+i] = 1; g[r+i][c] = 1; g[r+i][c+6] = 1; } for (let i = 2; i < 5; i++) for (let j = 2; j < 5; j++) g[r+i][c+j] = 1; }; place(0, 0); place(0, N - 7); place(N - 7, 0); // timing lines for (let i = 8; i < N - 8; i++) { g[6][i] = i % 2 === 0 ? 1 : 0; g[i][6] = i % 2 === 0 ? 1 : 0; } return g; }, [seed]); const cell = size / N; return ( ); }; /* ────────────────────────────────────────────────────────── HOME — based on variant B (minimaliste) with subtle photo ──────────────────────────────────────────────────────── */ const SearchEditor = ({ values, onClose, onApply, onSearch }) => { const [v, setV] = React.useState(values); const apply = () => { onApply(v); onClose(); }; const search = () => { onApply(v); onSearch(v); onClose(); }; return (
{t('Définissez votre trajet, on cherche les billets disponibles.')}
{t('Avion, train, bateau, bus longue distance. Comparez')}{' '} {dbStats ? dbStats.compagnies.toLocaleString(window.VA_I18N.locale()) : '…'}{' '} {t('compagnies en un seul écran, gérez ensuite vos billets avec un assistant qui ne dort jamais.')}