import { Suspense } from "react";
import type { Metadata } from "next";
import { SiteFooter } from "@/components/site-footer";
import {
  OdemeSonucKarti,
  OdemeSonucKartiSkeleton,
} from "@/features/odeme/components/odeme-sonuc-karti";

export const metadata: Metadata = {
  title: "Ödeme Sonucu",
  robots: { index: false, follow: false },
};

export default function OdemeSonucPage({
  searchParams,
}: {
  searchParams: Promise<{ siparis?: string }>;
}) {
  return (
    <div className="flex min-h-screen flex-col bg-slate-50 text-slate-900">
      <main className="mx-auto flex w-full max-w-md flex-1 flex-col justify-center px-4 py-16 text-center">
        <Suspense fallback={<OdemeSonucKartiSkeleton />}>
          {searchParams.then(({ siparis }) => (
            <OdemeSonucKarti siparis={siparis} />
          ))}
        </Suspense>
      </main>
      <SiteFooter />
    </div>
  );
}
