import { notFound } from "next/navigation";
import { fetchVideoContent } from "@/lib/data";
import VideoPlayerUI from "../../../src/components/VideoDetailUI/VideoDetailsUi";

type Props = {
  params: Promise<{ reelId: string }>;
  searchParams: Promise<{ [key: string]: string | string[] | undefined }>;
};

export default async function VideoPage({ params }: Props) {
  const { reelId } = await params;
  if (!reelId) {
    notFound();
  }

  const videoData = await fetchVideoContent(reelId, "");

  if (!videoData) {
    notFound();
  }

  return <VideoPlayerUI data={videoData} />;
}
