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

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

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

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

  if (!videoData) {
    notFound();
  }

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