import { createFileRoute } from '@tanstack/react-router'; import Hero from '../components/Hero/Hero'; import InstagramGrid from '../components/InstagramGrid/InstagramGrid'; import AboutBlock from '../components/home/AboutBlock/AboutBlock'; import ContactSection from '../components/home/ContactSection/ContactSection'; import Pricing from '../components/home/Pricing/Pricing'; import Testimonials from '../components/home/Testimonials/Testimonials'; import IntroGallery from '../components/home/IntroGallery/IntroGallery'; import heroContent from '../content/heroContent'; import homeContent from '../content/homeContent'; import instagramContent from '../content/instagramContent'; import packages from '../content/packages'; import testimonials from '../content/testimonials'; import siteContent from '../content/siteContent'; import { visibleSocials } from '../lib/visibleSocials'; import useHydrated from '../hooks/useHydrated'; import { pageHead } from '../seo'; // ?pakket= from a "Boek" link on a price card. Only text is kept; whether it // names a real package is checked against the shown packages (BR-PARAM-01). type HomeSearch = { pakket?: string }; export const Route = createFileRoute('/')({ validateSearch: (search: Record): HomeSearch => typeof search.pakket === 'string' ? { pakket: search.pakket } : {}, head: () => pageHead('/'), component: Index, }); // The homepage: the hero, then the sections in the order of LAYOUT.md function Index() { const { pakket: searched } = Route.useSearch(); // The search only counts after hydration, so the prerendered HTML and the // first browser render agree (BR-HYD-10) const pakket = useHydrated() ? searched : undefined; // Without a valid https link the tiles would lead nowhere: no section const instagram = visibleSocials(siteContent.socials).find( (social) => social.platform === 'instagram', ); return ( <> {instagram && ( )} ); }