import type { Metadata } from "next";
import { FavoritesList } from "@/components/game/FavoritesList";
import { SectionHeading } from "@/components/ui/Section";
import { listGames } from "@/lib/games";

export const metadata: Metadata = {
  title: "Favorites",
  description: "Your saved favorite games.",
};

/** Favorites: server supplies the catalog, client joins browser storage. */
export default async function FavoritesPage() {
  const { games } = await listGames({ pageSize: 48 });

  return (
    <div className="shell py-10">
      <SectionHeading
        eyebrow="Your collection"
        title="Favorites"
        description="Games you save will live here in your browser — no account needed."
      />
      <FavoritesList games={games} />
    </div>
  );
}
