'use client';

import { Hero } from '@/components/home/Hero';
import { TelemetryStrip } from '@/components/home/TelemetryStrip';
import { ValuePillars } from '@/components/home/ValuePillars';
import { StewardingPreview } from '@/components/home/StewardingPreview';
import { LeagueIdentityPreview } from '@/components/home/LeagueIdentityPreview';
import { MigrationSection } from '@/components/home/MigrationSection';
import { CtaSection } from '@/components/home/CtaSection';
import { Stack } from '@/ui/Stack';

export interface HomeViewData {
  isAlpha: boolean;
  upcomingRaces: Array<{
    id: string;
    track: string;
    car: string;
    formattedDate: string;
  }>;
  topLeagues: Array<{
    id: string;
    name: string;
    description: string;
  }>;
  teams: Array<{
    id: string;
    name: string;
    description: string;
    logoUrl?: string;
  }>;
}

interface HomeTemplateProps {
  viewData: HomeViewData;
}

/**
 * HomeTemplate - Radically redesigned for League Admin focus.
 * Theme: Modern Precision.
 * Architecture: Composition of semantic components.
 */
export function HomeTemplate({ viewData }: HomeTemplateProps) {
  return (
    <main>
      <Stack gap={0}>
        {/* Hero Section - Admin Focus */}
        <Hero />

        {/* Admin Pain/Solution Strip */}
        <TelemetryStrip />

        {/* Core Admin Features */}
        <ValuePillars />

        {/* Stewarding Workflow Preview */}
        <StewardingPreview 
          race={viewData.upcomingRaces[0]} 
          team={viewData.teams[0]}
        />

        {/* League Identity Showcase */}
        <LeagueIdentityPreview 
          league={viewData.topLeagues[0]} 
        />

        {/* Migration Offer */}
        <MigrationSection />

        {/* Final CTA */}
        <CtaSection />
      </Stack>
    </main>
  );
}
