import React, { useEffect, useState, useMemo, useRef } from 'react'; import { BrowserRouter as Router, Routes, Route, useNavigate, useParams, Link, useLocation, Navigate } from 'react-router-dom'; import { supabase, getAppConfig } from './lib/supabase'; import { Category, Product, ProductPrice, ShopConfig, CartItem } from './types'; import { ShoppingCart, ArrowLeft, Package, Info, ChevronDown, LayoutGrid, MessageSquare, ExternalLink, Leaf, Plus, Minus, Trash2, MapPin, Check, Send, Search, Loader2, Heart, ShieldCheck, ChevronRight, Settings, Save, X as CloseIcon, Eye, EyeOff, Power, Bell, Users, FileText, Layout, RefreshCw, Truck, UserCheck, ImagePlus, ShieldAlert, Skull, Terminal, AlertTriangle, CheckCircle2, XCircle, BarChart3, Download, Edit, ChevronLeft, Clock, Globe, Cpu, Activity, Shield, Lock, ClipboardList, User, Calendar, History, Navigation } from 'lucide-react'; import { motion, AnimatePresence, useScroll, useTransform, Reorder } from 'motion/react'; import { clsx, type ClassValue } from 'clsx'; import { twMerge } from 'tailwind-merge'; const cn = (...inputs: ClassValue[]) => { return twMerge(clsx(inputs)); }; const darkenColor = (hex: string, percent: number) => { const num = parseInt(hex.replace('#', ''), 16); const amt = Math.round(2.55 * percent); const R = (num >> 16) - amt; const G = (num >> 8 & 0x00FF) - amt; const B = (num & 0x0000FF) - amt; return '#' + (0x1000000 + (R < 255 ? R < 0 ? 0 : R : 255) * 0x10000 + (G < 255 ? G < 0 ? 0 : G : 255) * 0x100 + (B < 255 ? B < 0 ? 0 : B : 255)).toString(16).slice(1); }; // --- Components --- const BackgroundParticles = () => { return (
{/* Nebula Glows */} {/* Standard Stars */} {[...Array(80)].map((_, i) => ( ))} {/* Shooting Stars */} {[...Array(3)].map((_, i) => ( ))}
); }; const ImageWithFallback = ({ src, alt, className, forceImageOnly, ...props }: React.ImgHTMLAttributes & { forceImageOnly?: boolean }) => { const [error, setError] = useState(false); const [loading, setLoading] = useState(true); const [isInView, setIsInView] = useState(false); const containerRef = useRef(null); const videoRef = useRef(null); const getMediaInfo = (s: string | null | undefined) => { if (!s) return { url: '', type: 'image', thumbnail: '' }; try { const media = JSON.parse(s); if (Array.isArray(media) && media.length > 0) { let selectedMedia = media[0]; if (forceImageOnly) { const firstImage = media.find(m => { const url = typeof m === 'string' ? m : m.url; return url && !url.match(/\.(mp4|webm|ogg|mov)$/i); }); if (firstImage) { selectedMedia = firstImage; } } const first = typeof selectedMedia === 'string' ? { url: selectedMedia, type: selectedMedia.match(/\.(mp4|webm|ogg|mov)$/i) ? 'video' : 'image' } : { ...selectedMedia }; // Cherche une miniature ou la première image de la liste pour servir de poster let thumbnail = first.thumbnail || first.poster || ''; if (!thumbnail && Array.isArray(media)) { const firstImage = media.find(m => { const url = typeof m === 'string' ? m : m.url; return url && !url.match(/\.(mp4|webm|ogg|mov)$/i); }); if (firstImage) { thumbnail = typeof firstImage === 'string' ? firstImage : firstImage.url; } } if (forceImageOnly && first.type === 'video') { return { url: thumbnail || `${first.url}#t=0.1`, type: 'image', thumbnail }; } return { ...first, thumbnail }; } } catch (e) {} const isVideo = s.match(/\.(mp4|webm|ogg|mov)$/i); if (forceImageOnly && isVideo) { return { url: `${s}#t=0.1`, type: 'image', thumbnail: `${s}#t=0.1` }; } return { url: s, type: isVideo ? 'video' : 'image', thumbnail: isVideo ? `${s}#t=0.1` : '' }; }; const media = getMediaInfo(src); useEffect(() => { const observer = new IntersectionObserver( (entries) => { entries.forEach((entry) => { setIsInView(entry.isIntersecting); }); }, { threshold: 0.01, rootMargin: '50px' // Charge un peu avant pour plus de fluidité } ); if (containerRef.current) observer.observe(containerRef.current); return () => observer.disconnect(); }, []); useEffect(() => { if (media.type === 'video' && videoRef.current) { if (isInView) { videoRef.current.play().catch(() => {}); } else { videoRef.current.pause(); } } }, [isInView, media.type]); return (
{loading && (
)} {media.type === 'video' ? (
); }; const BottomNav = ({ cartCount, config }: { cartCount: number, config: ShopConfig | null }) => { const location = useLocation(); const navigate = useNavigate(); const handleContact = () => { const username = import.meta.env.VITE_ORDER_MANAGER_USERNAME || config?.orderManager?.replace('@', '') || 'username'; const url = `https://t.me/${username}`; if (window.Telegram?.WebApp) { window.Telegram.WebApp.openTelegramLink(url); } else { window.open(url, '_blank'); } }; const tgUser = (window as any).Telegram?.WebApp?.initDataUnsafe?.user; const userId = tgUser?.id?.toString() || ''; const isPrivileged = config && (userId === config.adminId || userId === config.managerChatId); const tabs = [ { id: 'catalogue', label: 'Catalogue', icon: LayoutGrid, onClick: () => navigate('/'), isActive: location.pathname === '/' }, { id: 'cart', label: 'Panier', icon: ShoppingCart, onClick: () => navigate('/cart'), isActive: location.pathname === '/cart' }, { id: 'infos', label: 'Infos', icon: Info, onClick: () => navigate('/infos'), isActive: location.pathname === '/infos' }, { id: 'contact', label: 'Contact', icon: MessageSquare, onClick: handleContact, isActive: false }, { id: 'orders', label: 'Profil', icon: tgUser?.photo_url ? () => (
Profile
) : ClipboardList, onClick: () => navigate('/orders'), isActive: location.pathname === '/orders' }, ]; return ( ); }; const SplashScreen = ({ config }: { config: ShopConfig | null }) => { const [progress, setProgress] = useState(0); const accentColor = config?.accentColor || '#A855F7'; useEffect(() => { const interval = setInterval(() => { setProgress(prev => { if (prev >= 100) { clearInterval(interval); return 100; } return prev + 1; }); }, 25); return () => clearInterval(interval); }, []); return ( {/* Background Grid & Energy */}
{/* Central Core */}
{/* Multi-Layered Neon Rings */} {/* Scanning Light Ring */} {/* Intense Pulsing Glow */} {/* Main Logo Container */}
{/* High-speed scan line */}
{/* Text Section */}
{config?.shopName || 'QUALITÉ'}
SERVICE PREMIUM
{/* Progress Bar Container */}
{/* Progress Glow Tip */}
System Initialization
Loading Assets...
{progress}%
{/* Final Exit Flash */} ); }; const Home = ({ config, fulfillmentType, setFulfillmentType, favorites, toggleFavorite }: { config: ShopConfig | null, fulfillmentType: 'delivery' | 'meetup' | null, setFulfillmentType: (type: 'delivery' | 'meetup' | null) => void, favorites: string[], toggleFavorite: (productId: string, onUpdate?: (isLiked: boolean) => void) => void }) => { const [categories, setCategories] = useState([]); const [products, setProducts] = useState<(Product & { prices?: ProductPrice[] })[]>([]); const [loading, setLoading] = useState(true); const [selectedCategory, setSelectedCategory] = useState(null); const [searchQuery, setSearchQuery] = useState(''); useEffect(() => { const fetchData = async () => { const [catRes, prodRes, priceRes] = await Promise.all([ supabase.from('categories').select('*').order('display_order', { ascending: true }), supabase.from('products').select('*').order('display_order', { ascending: true }), supabase.from('product_prices').select('*') ]); if (catRes.data) setCategories(catRes.data); if (prodRes.data) { const prodsWithPrices = prodRes.data.map(p => ({ ...p, prices: (priceRes.data || []).filter((pr: any) => pr.product_id === p.id).sort((a: any, b: any) => a.price - b.price) })); setProducts(prodsWithPrices); } setLoading(false); }; fetchData(); }, []); // Filter categories and products based on fulfillment type and search const activeFulfillment = fulfillmentType || 'delivery'; const { scrollY } = useScroll(); // Header animations const headerOpacity = useTransform(scrollY, [0, 100], [1, 0]); const headerScale = useTransform(scrollY, [0, 100], [1, 0.9]); const stickyLogoOpacity = useTransform(scrollY, [120, 180], [0, 1]); const stickyLogoScale = useTransform(scrollY, [120, 180], [0.5, 1]); const categoriesTranslateX = useTransform(scrollY, [120, 180], [0, 45]); const filteredCategories = categories.filter(c => (c.type || 'delivery') === activeFulfillment); const filteredProducts = products.filter(p => (p.type || 'delivery') === activeFulfillment) .filter(p => !selectedCategory || p.category_id === selectedCategory) .filter(p => p.name.toLowerCase().includes(searchQuery.toLowerCase()) || p.description?.toLowerCase().includes(searchQuery.toLowerCase())); if (loading) return (
); if (config?.isMeetupEnabled && !fulfillmentType) { return (
{config?.shopLogo ? (
) : (
)}

Mode de Réception

Choisissez votre préférence de retrait

setFulfillmentType('delivery')} className="group relative overflow-hidden bg-bg-card/40 backdrop-blur-xl border border-white/5 p-8 rounded-[2.5rem] flex flex-col items-center gap-4 transition-all hover:border-accent/40 hover:shadow-[0_20px_40px_rgba(0,0,0,0.4)]" >
Livraison À domicile
setFulfillmentType('meetup')} className="group relative overflow-hidden bg-bg-card/40 backdrop-blur-xl border border-white/5 p-8 rounded-[2.5rem] flex flex-col items-center gap-4 transition-all hover:border-accent/40 hover:shadow-[0_20px_40px_rgba(0,0,0,0.4)]" >
Meet-up Main à main

{config?.shopName || 'HFT FRANCE'} • PREMIUM SERVICE

); } return ( {/* Header Section - Video Style */}
{/* Banner Background */} {config?.shopBanner && (
Banner
)}
{config?.shopLogo ? ( Logo ) : (
)}

{config?.shopName || 'HFT FRANCE'}

{config?.isMeetupEnabled && ( )}
{/* Content Section - Rounded Sheet */}
{/* Categories Section - Video Style */}
{/* Sticky Logo - Appears on scroll */} {config?.shopLogo ? ( Logo ) : (
)}
{filteredCategories.map(cat => ( ))}
{/* Search Bar - Moved below categories */}
setSearchQuery(e.target.value)} className="w-full bg-bg-card/50 border border-border rounded-full py-3.5 pl-12 pr-4 text-xs font-bold text-white placeholder:text-text-muted/50 focus:outline-none focus:border-accent/50 transition-all backdrop-blur-md" />
{/* Products Grid - Video Style */}
{filteredProducts.map((product) => (
{/* Badges */}
{product.is_in_stock ? 'En stock' : 'Rupture'}
{/* Gradient Overlay */}
{/* Heart Icon */} {/* Product Info - Video Style */}

{product.name}

{product.description || 'Qualité supérieure'}

{product.prices?.[0]?.price || 0}€
))}
{filteredProducts.length === 0 && (

Aucun produit trouvé

)}
); }; const ImageLightbox = ({ images, initialIndex = 0, onClose }: { images: string[]; initialIndex?: number; onClose: () => void }) => { const [currentIndex, setCurrentIndex] = useState(initialIndex); const handleNext = (e: React.MouseEvent) => { e.stopPropagation(); setCurrentIndex((prev) => (prev + 1) % images.length); }; const handlePrev = (e: React.MouseEvent) => { e.stopPropagation(); setCurrentIndex((prev) => (prev - 1 + images.length) % images.length); }; return ( {images.length > 1 && ( <>
{images.map((_, i) => (
))}
)} e.stopPropagation()} /> ); }; const ProductDetail = ({ config, addToCart, favorites, toggleFavorite }: { config: ShopConfig | null, addToCart: (item: CartItem) => void, favorites: string[], toggleFavorite: (productId: string, onUpdate?: (isLiked: boolean) => void) => void }) => { const { productId } = useParams(); const navigate = useNavigate(); const [product, setProduct] = useState(null); const [prices, setPrices] = useState([]); const [loading, setLoading] = useState(true); const [addedPriceId, setAddedPriceId] = useState(null); const [currentImageIndex, setCurrentImageIndex] = useState(0); const getProductImages = (imgUrl: string | null | undefined): { url: string, type: 'image' | 'video' }[] => { if (!imgUrl) return []; try { const parsed = JSON.parse(imgUrl); if (Array.isArray(parsed)) { const media = parsed.map(item => typeof item === 'string' ? { url: item, type: item.match(/\.(mp4|webm|ogg|mov)$/i) ? 'video' : 'image' } : item); // Trier pour mettre les vidéos en premier return media.sort((a, b) => { if (a.type === 'video' && b.type !== 'video') return -1; if (a.type !== 'video' && b.type === 'video') return 1; return 0; }); } } catch (e) {} return imgUrl ? [{ url: imgUrl, type: imgUrl.match(/\.(mp4|webm|ogg|mov)$/i) ? 'video' : 'image' }] : []; }; const productImages = getProductImages(product?.image_url); useEffect(() => { const fetchData = async () => { const [prodRes, priceRes] = await Promise.all([ supabase.from('products').select('*').eq('id', productId).single(), supabase.from('product_prices').select('*').eq('product_id', productId).order('price', { ascending: true }) ]); if (prodRes.data) setProduct(prodRes.data); if (priceRes.data) setPrices(priceRes.data); setLoading(false); }; fetchData(); }, [productId]); const handleAddToCart = (price: ProductPrice) => { if (!product) return; addToCart({ productId: product.id, productName: product.name, priceId: price.id, quantityLabel: price.quantity, price: price.price, count: 1 }); setAddedPriceId(price.id); setTimeout(() => setAddedPriceId(null), 2000); }; if (loading) return (
); if (!product) return
Produit non trouvé.
; return ( {/* Immersive Product Image Header with Carousel */}
{/* Carousel Controls */} {productImages.length > 1 && ( <>
{/* Dots */}
{productImages.map((_, idx) => (
)}
{/* Floating Back Button */} {/* Floating Favorite Button */}
{/* Product Title & Badge */}
{product.is_in_stock ? '✨ En stock' : '❌ Rupture de stock'} {product.name} {product.description || "Un produit d'exception sélectionné pour sa qualité inégalée."}
{/* Prices Section */}

Formats Disponibles

{prices.map((price, idx) => (
Quantité {price.quantity}
Prix unitaire {price.price}€
))}
); }; const Infos = ({ config }: { config: ShopConfig | null }) => { const navigate = useNavigate(); const tgUser = (window as any).Telegram?.WebApp?.initDataUnsafe?.user; const userId = tgUser?.id?.toString() || ''; const isPrivileged = config && (userId === config.adminId || userId === config.managerChatId); return (
À propos

Informations

Découvrez comment nous garantissons la meilleure expérience pour {config?.shopName || 'notre communauté'}.

{isPrivileged && ( )}
{config?.infoText ? (

Guide d'utilisation

{config.infoText}
) : ( [ { title: 'Livraison', content: 'Expédition rapide et discrète sous 24/48h avec suivi en temps réel.', icon: Package, color: 'text-accent' }, { title: 'Paiement', content: 'Transactions sécurisées via Crypto-monnaies pour une confidentialité totale.', icon: ShoppingCart, color: 'text-accent' }, { title: 'Support 24/7', content: 'Une équipe dédiée à votre écoute sur Telegram pour toute question.', icon: MessageSquare, color: 'text-accent' }, ].map((item, i) => (

{item.title}

{item.content}

)) )}
{/* Premium Badge */}

Service Gold

Qualité supérieure garantie

); }; const ShopClosed = ({ config }: { config: ShopConfig | null }) => { const handleContact = () => { const url = `https://t.me/${config?.orderManager || 'username'}`; if (window.Telegram?.WebApp) { window.Telegram.WebApp.openTelegramLink(url); } else { window.open(url, '_blank'); } }; return (
FERMÉ

{config?.shopName || 'Le Shop'} est fermé

Nous sommes actuellement fermés. Revenez plus tard pour passer commande ou contactez-nous directement.

); }; // --- Main App --- const Cart = ({ config, cart, updateQuantity, removeFromCart, fulfillmentType, modifyingOrderId, modifyingOrderAddress, clearCart }: { config: ShopConfig | null, cart: CartItem[], updateQuantity: (priceId: string, delta: number) => void, removeFromCart: (priceId: string) => void, fulfillmentType: 'delivery' | 'meetup' | null, modifyingOrderId: string | null, modifyingOrderAddress: any | null, clearCart: () => void }) => { const [streetNumber, setStreetNumber] = useState(''); const [streetName, setStreetName] = useState(''); const [city, setCity] = useState(''); const [postalCode, setPostalCode] = useState(''); const [comment, setComment] = useState(''); const [phone, setPhone] = useState(''); const [suggestions, setSuggestions] = useState([]); const [selectedCoords, setSelectedCoords] = useState<{lat: string, lon: string} | null>(null); const [isSearching, setIsSearching] = useState(false); const [showSuggestions, setShowSuggestions] = useState(false); const navigate = useNavigate(); const tgUser = (window as any).Telegram?.WebApp?.initDataUnsafe?.user; // Pre-fill address when modifying an order useEffect(() => { if (modifyingOrderId && modifyingOrderAddress) { if (typeof modifyingOrderAddress === 'object') { setStreetNumber(modifyingOrderAddress.streetNumber || ''); setStreetName(modifyingOrderAddress.streetName || ''); setCity(modifyingOrderAddress.city || ''); setPostalCode(modifyingOrderAddress.postalCode || ''); setComment(modifyingOrderAddress.comment || ''); } else if (typeof modifyingOrderAddress === 'string' && modifyingOrderAddress !== 'MEETUP') { // Parse the address string if it's not JSON // Format: "123 Rue de la Paix, 75000 Paris (Comment)|lat,lon" const parts = modifyingOrderAddress.split('|'); const mainPart = parts[0]; const coordsPart = parts[1]; // Simple parsing logic const commentMatch = mainPart.match(/\((.*?)\)$/); const commentText = commentMatch ? commentMatch[1] : ''; const addressWithoutComment = mainPart.replace(/\s*\(.*?\)$/, ''); const addressParts = addressWithoutComment.split(', '); if (addressParts.length >= 2) { const streetPart = addressParts[0]; const cityPart = addressParts[1]; // Street number and name const streetMatch = streetPart.match(/^(\d+)?\s*(.*)$/); if (streetMatch) { setStreetNumber(streetMatch[1] || ''); setStreetName(streetMatch[2] || ''); } // Postal code and city const cityMatch = cityPart.match(/^(\d{5})?\s*(.*)$/); if (cityMatch) { setPostalCode(cityMatch[1] || ''); setCity(cityMatch[2] || ''); } setComment(commentText); if (coordsPart) { const [lat, lon] = coordsPart.split(','); setSelectedCoords({ lat, lon }); } } } } }, [modifyingOrderId, modifyingOrderAddress]); useEffect(() => { if (tgUser?.username) { setPhone(`@${tgUser.username}`); } }, [tgUser]); const handleGeolocation = () => { if (!navigator.geolocation) { (window as any).Telegram?.WebApp?.showAlert?.("La géolocalisation n'est pas supportée par votre navigateur."); return; } setIsSearching(true); navigator.geolocation.getCurrentPosition(async (position) => { const { latitude, longitude } = position.coords; try { const response = await fetch(`https://nominatim.openstreetmap.org/reverse?format=jsonv2&lat=${latitude}&lon=${longitude}`); const data = await response.json(); if (data.address) { setStreetNumber(data.address.house_number || ''); setStreetName(data.address.road || ''); setCity(data.address.city || data.address.town || data.address.village || ''); setPostalCode(data.address.postcode || ''); setSelectedCoords({ lat: latitude.toString(), lon: longitude.toString() }); } } catch (error) { console.error("Error reverse geocoding:", error); } finally { setIsSearching(false); } }, (error) => { console.error("Geolocation error:", error); setIsSearching(false); let errorMsg = "Erreur lors de la récupération de votre position."; if (error.code === 1) errorMsg = "Permission de géolocalisation refusée. Veuillez l'activer dans les réglages de votre navigateur."; else if (error.code === 2) errorMsg = "Position indisponible."; else if (error.code === 3) errorMsg = "Délai d'attente dépassé."; (window as any).Telegram?.WebApp?.showAlert?.(errorMsg); }, { enableHighAccuracy: true, timeout: 10000, maximumAge: 0 }); }; useEffect(() => { const timer = setTimeout(async () => { const fullSearch = `${streetNumber} ${streetName} ${city} ${postalCode}`.trim(); if (fullSearch.length > 3 && showSuggestions) { setIsSearching(true); try { const response = await fetch(`https://nominatim.openstreetmap.org/search?format=jsonv2&q=${encodeURIComponent(fullSearch)}&limit=10&addressdetails=1&countrycodes=fr&dedupe=1`); const data = await response.json(); const sorted = data.sort((a: any, b: any) => (b.importance || 0) - (a.importance || 0)); setSuggestions(sorted); } catch (error) { console.error("Error fetching suggestions:", error); } finally { setIsSearching(false); } } else { setSuggestions([]); } }, 600); return () => clearTimeout(timer); }, [streetNumber, streetName, city, postalCode, showSuggestions]); const handleSelectAddress = (suggestion: any) => { if (suggestion.address) { setStreetNumber(suggestion.address.house_number || ''); setStreetName(suggestion.address.road || ''); setCity(suggestion.address.city || suggestion.address.town || suggestion.address.village || ''); setPostalCode(suggestion.address.postcode || ''); } setSelectedCoords({ lat: suggestion.lat, lon: suggestion.lon }); setSuggestions([]); setShowSuggestions(false); }; const [isCheckingOut, setIsCheckingOut] = useState(false); const [orderSuccess, setOrderSuccess] = useState(false); const total = cart.reduce((acc, item) => acc + (item.price * item.count), 0); const handleCheckout = async () => { if (cart.length === 0) return; if (fulfillmentType !== 'meetup' && (!streetName.trim() || !city.trim() || !postalCode.trim())) { (window as any).Telegram?.WebApp?.showAlert?.("Veuillez remplir les informations de livraison (Rue, Ville, Code Postal)."); return; } const telegramUser = (window.Telegram?.WebApp as any)?.initDataUnsafe?.user; if (!telegramUser?.username && !phone.trim()) { (window as any).Telegram?.WebApp?.showAlert?.("Veuillez entrer votre numéro de téléphone ou avoir un nom d'utilisateur Telegram."); return; } setIsCheckingOut(true); const date = new Date().toLocaleDateString('fr-FR', { day: '2-digit', month: 'long', year: 'numeric', hour: '2-digit', minute: '2-digit' }); try { const fullAddress = `${streetNumber} ${streetName}, ${postalCode} ${city}${comment ? ` (${comment})` : ''}`.trim(); const orderAddress = fulfillmentType === 'meetup' ? 'MEETUP' : (selectedCoords ? `${fullAddress}|${selectedCoords.lat},${selectedCoords.lon}` : fullAddress); const endpoint = modifyingOrderId ? '/api/orders/modify' : '/api/orders'; const payload = { orderId: modifyingOrderId, cart, total, address: orderAddress, phone, date, type: fulfillmentType || 'delivery', telegramId: telegramUser?.id, telegramUsername: telegramUser?.username, telegramFirstName: telegramUser?.first_name }; const response = await fetch(endpoint, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(payload) }); if (response.ok) { setOrderSuccess(true); clearCart(); } else { const errData = await response.json(); (window as any).Telegram?.WebApp?.showAlert?.(errData.error || "Une erreur est survenue."); } } catch (error) { console.error('Order error:', error); (window as any).Telegram?.WebApp?.showAlert?.("Une erreur est survenue lors de l'envoi de la commande."); } finally { setIsCheckingOut(false); } }; if (orderSuccess) { return (

{modifyingOrderId ? "Commande Modifiée !" : "Commande Envoyée !"}

{modifyingOrderId ? "Votre commande a été mise à jour avec succès. Le livreur en a été informé." : (fulfillmentType === 'meetup' ? "Votre commande a été reçue. Un collaborateur va vous contacter sous peu pour le point de rendez-vous." : "Un livreur va vous répondre sous peu veuillez rester attentif")}

); } return (
{/* Background Glows */}
{/* Header Section */}
{modifyingOrderId && (

Mode Modification

Modification de la commande de {tgUser?.first_name || 'Client'}

)}

Mon Panier

{cart.length} {cart.length > 1 ? 'articles sélectionnés' : 'article sélectionné'}

{cart.length === 0 ? (

Votre panier est vide

Explorez notre catalogue premium pour commencer votre sélection

) : ( <> {/* Cart Items List */}

Détails de la commande

{cart.map((item, idx) => (
Article sélectionné

{item.productName}

Format {item.quantityLabel}
Prix {item.price}€
{item.count}
))}
{modifyingOrderId && ( )} {fulfillmentType !== 'meetup' && (
setStreetNumber(e.target.value)} placeholder="N°" className="w-full bg-bg-card/40 backdrop-blur-md border border-border rounded-2xl p-4 text-white text-base font-bold placeholder:text-white/10 focus:border-accent/40 focus:outline-none transition-all premium-shadow uppercase" />
{ setStreetName(e.target.value); setShowSuggestions(true); }} onFocus={() => setShowSuggestions(true)} onBlur={() => setTimeout(() => setShowSuggestions(false), 200)} placeholder="Rue / Avenue..." className="w-full bg-bg-card/40 backdrop-blur-md border border-border rounded-2xl p-4 text-white text-base font-bold placeholder:text-white/10 focus:border-accent/40 focus:outline-none transition-all premium-shadow uppercase" /> {suggestions.length > 0 && showSuggestions && ( {suggestions.map((s, i) => ( ))} )}
setPostalCode(e.target.value)} placeholder="Code Postal" className="w-full bg-bg-card/40 backdrop-blur-md border border-border rounded-2xl p-4 text-white text-base font-bold placeholder:text-white/10 focus:border-accent/40 focus:outline-none transition-all premium-shadow uppercase" /> setCity(e.target.value)} placeholder="Ville" className="w-full bg-bg-card/40 backdrop-blur-md border border-border rounded-2xl p-4 text-white text-base font-bold placeholder:text-white/10 focus:border-accent/40 focus:outline-none transition-all premium-shadow uppercase" />