import { Metadata, ResolvingMetadata } from "next";
import {
  NewsIndexView,
  loadNewsIndexProps,
} from "@/components/news/NewsIndexView";
import { getSeoMetadata } from "@/lib/seo";

export async function generateMetadata(
  _: unknown,
  parent: ResolvingMetadata
): Promise<Metadata | null> {
  const { index } = await loadNewsIndexProps();
  return getSeoMetadata(index, parent);
}

export default async function Page() {
  const props = await loadNewsIndexProps();
  return <NewsIndexView {...props} />;
}
