"use client";

import dynamic from "next/dynamic";

// Above-the-fold sections: enable SSR for better FCP/LCP
const WhyChooseLazy = dynamic(() => import("@/routes/Scilly/whyChoose"), { ssr: true });
const SpecialLazy = dynamic(() => import("@/routes/Scilly/special"), { ssr: true });
const WeekendEscapeLazy = dynamic(() => import("@/routes/Scilly/weekendEscape"), { ssr: true });

// Below-the-fold sections: disable SSR to reduce initial bundle size
const TestimonialsLazy = dynamic(() => import("@/routes/Scilly/testimonials"), { ssr: false });
const AwardsLazy = dynamic(() => import("@/routes/Scilly/Awards"), { ssr: false });
const ReadyToParadiseLazy = dynamic(() => import("@/routes/Scilly/readytoparadise"), { ssr: false });
const GalleryLazy = dynamic(() => import("@/routes/Scilly/gallery"), { ssr: false });
const RequestFormLazy = dynamic(() => import("@/routes/Scilly/requestForm"), { ssr: false });
const FooterLazy = dynamic(() => import("@/routes/Scilly/footer"), { ssr: false });
const FloatingButtonLazy = dynamic(() => import("@/routes/Scilly/floatingButton"), { ssr: false });
const CookieConsentLazy = dynamic(() => import("@/routes/Scilly/cookieConsent"), { ssr: false });

// eslint-disable-next-line @typescript-eslint/no-explicit-any
type AnyData = any;

export function WhyChooseSection({ data }: { data: AnyData }) {
  return <WhyChooseLazy data={data} />;
}

export function SpecialSection({ data }: { data: AnyData }) {
  return <SpecialLazy data={data} />;
}

export function WeekendEscapeSection({ data }: { data: AnyData }) {
  return <WeekendEscapeLazy data={data} />;
}

export function TestimonialsSection({ data }: { data: AnyData }) {
  return <TestimonialsLazy data={data} />;
}

export function AwardsRecognition({ data }: { data: AnyData }) {
  return <AwardsLazy data={data} />;
}

export function ReadyToExperienceParadise({ data }: { data: AnyData }) {
  return <ReadyToParadiseLazy data={data} />;
}

export function ScillyImageGallery({ data }: { data: AnyData }) {
  return <GalleryLazy data={data} />;
}

export function RequestForm({ data }: { data: AnyData }) {
  return <RequestFormLazy data={data} />;
}

export function Footer({ data }: { data: AnyData }) {
  return <FooterLazy data={data} />;
}

export function FloatingBookButton({ cta }: { cta: AnyData }) {
  return <FloatingButtonLazy cta={cta} />;
}

export function CookieConsent({ data }: { data: AnyData }) {
  return <CookieConsentLazy data={data} />;
}
