import * as React from "react";
import { Spotlight } from "./spotlight";
import { Pages } from "./pages";
import { Video } from "./video";
import { Playlist } from "../playlist";
import { LandingContent } from "./landing";

interface LandingComponentProps {
  item: LandingContent;
}

export const Landing = ({ item }: LandingComponentProps) => {
  if (item.kind === "pagesRow") {
    return <Pages pages={item.pages}></Pages>;
  } else if (item.kind === "spotlight") {
    return <Spotlight data={item.data} />;
  } else if (item.kind === "video") {
    return <Video id={item.video._id} />;
  } else if (item.kind === "playlist") {
    return <Playlist id={item.playlist._id} />;
  } else {
    return <></>;
  }
};
