import Hero from "@/components/Hero";
import ScheduleBoard from "@/components/ScheduleBoard";
import Ado2Ad from "@/components/Ado2Ad";
import Footer from "@/components/Footer";
import { parseLang, dict } from "@/lib/i18n";

// L1. 전체 일정 대시보드 (랜딩 진입)
export default async function Home({
  searchParams,
}: {
  searchParams: Promise<{ lang?: string }>;
}) {
  const { lang: langParam } = await searchParams;
  const lang = parseLang(langParam);
  const t = dict(lang);
  return (
    <main className="shell">
      <Hero lang={lang} />

      {/* 기간 안내 + CTA 영역 */}
      <div className="mt-5 rounded-2xl border border-[var(--line-d)] bg-[var(--bg2)] p-4 text-center">
        <p className="whitespace-pre-line text-[14px] font-bold leading-snug">
          {t.introLead}
        </p>
        <p className="mt-1 text-[14px] font-bold leading-snug text-[var(--green)]">
          {t.prizeLine1}
          <br />
          <span className="whitespace-nowrap">{t.prizeLine2}</span>
        </p>
      </div>

      <ScheduleBoard lang={lang} />
      <Ado2Ad lang={lang} />
      <Footer lang={lang} />
    </main>
  );
}
