def fromFaciaContentAndCardType()

in common/app/model/FaciaDisplayElement.scala [11:32]


  def fromFaciaContentAndCardType(
      faciaContent: PressedContent,
      itemClasses: ItemClasses,
  ): Option[FaciaDisplayElement] = {
    faciaContent.mainVideo match {
      case Some(videoElement) if faciaContent.properties.showMainVideo =>
        Some(
          InlineVideo(
            videoElement,
            faciaContent.properties.webTitle,
            InlineImage.fromFaciaContent(faciaContent),
          ),
        )
      case _ if faciaContent.properties.isCrossword && Switches.CrosswordSvgThumbnailsSwitch.isSwitchedOn =>
        faciaContent.properties.maybeContentId map CrosswordSvg
      case _ if faciaContent.properties.imageSlideshowReplace && itemClasses.canShowSlideshow =>
        InlineSlideshow.fromFaciaContent(faciaContent)
      case _ if faciaContent.properties.showMainVideo && faciaContent.mainYouTubeMediaAtom.isDefined =>
        Some(InlineYouTubeMediaAtom(faciaContent.mainYouTubeMediaAtom.get, faciaContent.trailPicture))
      case _ => InlineImage.fromFaciaContent(faciaContent)
    }
  }