import { fetchMainPageContent } from '@/features/pages/services/pages.service';

import { AboutSection } from '@/widgets/about-section';
import { AppDownloadSection } from '@/widgets/app-download-section';
import { CharitySection } from '@/widgets/charity-section';
import { CtaSection } from '@/widgets/cta-section';
import { HeroSection } from '@/widgets/hero-section';
import { MapSection } from '@/widgets/map-section';
import { PartnersSection } from '@/widgets/partners-section';
import { PromotionsSection } from '@/widgets/promotions-section';
import { StatsSection } from '@/widgets/stats-section';
import { VacanciesSection } from '@/widgets/vacancies-section';

export default async function Home() {
  const data = await fetchMainPageContent();

  if (!data) return null;

  return (
    <main>
      <HeroSection />
      <AppDownloadSection />
      <StatsSection />
      <MapSection stations={data.stations} />
      <AboutSection />
      <PromotionsSection discounts={data.discounts} />
      <VacanciesSection jobs={data.jobs} />
      <PartnersSection partners={data.partners} />
      <CharitySection />
      <CtaSection />
    </main>
  );
}
