import type { Metadata } from "next";
import { buildStorefrontMetadata, StorefrontPageView } from "./storefront-page-view";

interface StorefrontHomeProps {
  params: Promise<{ slug: string }>;
}

export async function generateMetadata({ params }: StorefrontHomeProps): Promise<Metadata> {
  const { slug } = await params;
  return buildStorefrontMetadata(slug, "home");
}

/** The store's landing page — the row with `is_home` on their site. */
export default async function StorefrontHomePage({ params }: StorefrontHomeProps) {
  const { slug } = await params;
  return <StorefrontPageView slug={slug} pageSlug="home" />;
}
