'use client'; import React, { useState, useEffect, useRef } from 'react'; import Image from 'next/image'; import Link from 'next/link'; import { useRouter } from 'next/navigation'; import { resolveImage } from '@/data/stitch-images'; import translations, { Language } from '@/data/translations'; import type { Segment } from '@/data/segments'; const LANGUAGES: { code: Language; label: string; name: string }[] = [ { code: 'fr', label: 'FR', name: 'Français' }, { code: 'en', label: 'EN', name: 'English' }, { code: 'nl', label: 'NL', name: 'Nederlands' }, { code: 'de', label: 'DE', name: 'Deutsch' }, ]; function Reveal({ children, delay = 0, className = '', }: { children: React.ReactNode; delay?: number; className?: string; }) { const ref = React.useRef(null); const [visible, setVisible] = React.useState(false); React.useEffect(() => { const el = ref.current; if (!el) return; const observer = new IntersectionObserver( ([entry]) => { if (entry.isIntersecting) setVisible(true); }, { threshold: 0.12 } ); observer.observe(el); return () => observer.disconnect(); }, []); return (
{children}
); } export default function SegmentPageClient({ data, lang }: { data: Segment; lang: Language }) { const router = useRouter(); const setLang = (next: Language) => { if (next !== lang) router.push(`/${next}/${data.slug}`); }; const [isLangOpen, setIsLangOpen] = useState(false); const [isMenuOpen, setIsMenuOpen] = useState(false); const [navVisible, setNavVisible] = useState(true); const [openFaq, setOpenFaq] = useState(null); const [formData, setFormData] = useState({ firstName: '', lastName: '', email: '', message: '' }); const [status, setStatus] = useState<'idle' | 'loading' | 'success' | 'error'>('idle'); const langDropdownRef = useRef(null); const lastScrollY = useRef(0); const t = translations[lang]; const s = data.translations[lang as keyof typeof data.translations]; useEffect(() => { const handleScroll = () => { const currentY = window.scrollY; setNavVisible(currentY < lastScrollY.current || currentY < 10); lastScrollY.current = currentY; }; window.addEventListener('scroll', handleScroll, { passive: true }); return () => window.removeEventListener('scroll', handleScroll); }, []); useEffect(() => { document.body.style.overflow = isMenuOpen ? 'hidden' : 'auto'; return () => { document.body.style.overflow = 'auto'; }; }, [isMenuOpen]); useEffect(() => { const handler = (e: MouseEvent) => { if (langDropdownRef.current && !langDropdownRef.current.contains(e.target as Node)) { setIsLangOpen(false); } }; document.addEventListener('mousedown', handler); return () => document.removeEventListener('mousedown', handler); }, []); const scrollToContact = (e: React.MouseEvent) => { e.preventDefault(); document.getElementById('contact')?.scrollIntoView({ behavior: 'smooth' }); }; const scrollToPricing = (e: React.MouseEvent) => { e.preventDefault(); document.getElementById('pricing')?.scrollIntoView({ behavior: 'smooth' }); }; const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); setStatus('loading'); try { const response = await fetch('https://formspree.io/f/xbdaajlo', { method: 'POST', headers: { 'Content-Type': 'application/json', Accept: 'application/json' }, body: JSON.stringify(formData), }); if (response.ok) { setStatus('success'); setFormData({ firstName: '', lastName: '', email: '', message: '' }); } else { setStatus('error'); } } catch { setStatus('error'); } }; const handleChange = (e: React.ChangeEvent) => { const { name, value } = e.target; setFormData((prev) => ({ ...prev, [name]: value })); }; return (
{/* Navbar */}
MyInfoMate Logo MyInfoMate
{t.nav.login}
{isLangOpen && (
{LANGUAGES.map((l) => ( ))}
)}
{/* Mobile Menu */}
setIsMenuOpen(false)} />
{/* Breadcrumb */}
arrow_back {s.nav.backLabel}
{/* Hero */}
museum {s.hero.badge}

{s.hero.title}

{s.hero.subtitle}

{/* Pain Points */}

{s.painPoints.label}

{s.painPoints.title}

{s.painPoints.items.map((item, i) => (
{item.icon}

{item.title}

{item.desc}

))}
{/* Features */}

{s.features.label}

{s.features.title}

{s.features.desc}

{s.features.items.map((item, i) => (
{item.icon}

{item.title}

{item.desc}

{s.features.valueLabel} {item.value}

))}
{/* Comparison */}

{s.comparison.label}

{s.comparison.title}

{s.comparison.items.map((item, i) => (
compare

vs

{item.competitor}

    {item.advantages.map((adv, j) => (
  • check_circle {adv}
  • ))}
))}
{/* Pricing */}

{t.pricing.sectionLabel}

{t.pricing.sectionTitle}

{t.pricing.sectionDesc}

{/* Essentiel */}
{t.pricing.comingSoon}

Essentiel

€39 {t.pricing.perMonth}

{t.pricing.htva} · {t.pricing.noCommitment}

    {[t.pricing.features.webAndKiosk, t.pricing.features.backoffice, t.pricing.features.sections].map((f) => (
  • check_circle {f}
  • ))}
  • check_circle 1 GB {t.pricing.features.storage}
  • check_circle {t.pricing.features.stats} — {t.pricing.features.statsBasicLabel}
  • {[t.pricing.features.nativeApp, t.pricing.features.offlineBeacons, t.pricing.features.pushNotif, t.pricing.features.ai, t.pricing.features.autoTranslation].map((f) => (
  • cancel {f}
  • ))}
{/* Pro */}
{t.pricing.recommended}

Pro

€99 {t.pricing.perMonth}

{t.pricing.htva}

{t.pricing.setupFeeNote}

    {[t.pricing.features.webAndKiosk, t.pricing.features.nativeApp, t.pricing.features.backoffice, t.pricing.features.sections].map((f) => (
  • check_circle {f}
  • ))}
  • check_circle 15 GB {t.pricing.features.storage}
  • {[t.pricing.features.offlineBeacons, t.pricing.features.pushNotif].map((f) => (
  • check_circle {f}
  • ))}
  • check_circle {t.pricing.features.stats} — {t.pricing.features.statsBasicLabel}
  • {[t.pricing.features.statsAdvancedFeature, t.pricing.features.ai, t.pricing.features.autoTranslation].map((f) => (
  • cancel {f}
  • ))}
{/* Bundle */}

Bundle

€179 {t.pricing.perMonth}

{t.pricing.htva}

{t.pricing.setupFeeNote}

    {[t.pricing.features.webAndKiosk, t.pricing.features.nativeApp, t.pricing.features.backoffice, t.pricing.features.sections].map((f) => (
  • check_circle {f}
  • ))}
  • check_circle 50 GB {t.pricing.features.storage}
  • {[t.pricing.features.offlineBeacons, t.pricing.features.pushNotif].map((f) => (
  • check_circle {f}
  • ))}
  • check_circle {t.pricing.features.statsAdvancedFeature}
  • check_circle {t.pricing.features.ai} — 2 000 {t.pricing.features.reqPerMonth}
  • check_circle {t.pricing.features.autoTranslation}
{/* FAQ */}

{s.faq.label}

{s.faq.title}

{s.faq.items.map((item, i) => (

{item.answer}

))}
{/* CTA */}

{s.cta.title}

{s.cta.subtitle}

{s.cta.button2}
{/* Contact */}

{t.contact.sectionLabel}

{t.contact.title}

{t.contact.subtitle}

{status === 'success' ? (
task_alt

{t.contact.successTitle}

{t.contact.successDesc}

) : (
{status === 'error' && (
error {t.contact.errorMsg}
)}
)}
{/* Footer */}
); }