import OwnerYearlyAuctionGroupLiveClient from "@/components/yearly/OwnerYearlyAuctionGroupLiveClient";
import { metaObject } from "@/config/site.config";
import { getLocale, getTranslations } from "next-intl/server";

export async function generateMetadata({
  params,
}: {
  params: Promise<{ auctionGroupId: string; lang: string }>;
}) {
  const { auctionGroupId } = await params;
  await getLocale();
  const t = await getTranslations("YEARLY_AUCTION_LIVE");
  let title = `التحكم المباشر - ${auctionGroupId}`;

  return metaObject(
    title,
    "صفحة التحكم المباشر للمزاد السنوي",
    undefined,
    undefined,
    `/dashboard/my-yearly-auctions/${auctionGroupId}/live`,
  );
}

type Props = {
  params: Promise<{ auctionGroupId: string; lang: string }>;
};

export default async function OwnerYearlyAuctionGroupLivePage({ params }: Props) {
  const { auctionGroupId } = await params;

  // For now, we'll fetch minimal data from the client component
  // If needed, we can add a server action to fetch auction group details
  // The client component will handle fetching from the list API or a detail endpoint

  return (
    <OwnerYearlyAuctionGroupLiveClient
      auctionGroupId={auctionGroupId}
    />
  );
}
