import { DefaultCell } from "./DefaultCell";
import { GridCell } from "./GridCell";
import { HeroCell } from "./HeroCell";
// import { ScreenSelectorLabel } from "./ScreenSelectorLabel";

/**
 * Return a view tree ready to be injected with styles etc. Mapping is done
 * via switch/case/default since some components share the same cell.
 * @param {string} component_type Usually comes from the layout.json,
 *                                but it could be any type supported by this plugin,
 *                                like the internally-used "label".
 * @return {Object} view tree function, ready to be injected with styles object
 */
export function viewTreeResolver({ component_type }) {
  switch (component_type) {
    case "hero":
      return HeroCell;
    // case "screen_picker":
    //   return ScreenSelectorLabel;
    case "grid":
      return GridCell;
    case "horizontal_list":
    default:
      return DefaultCell;
  }
}
