package sqwl.cms.layout
import scalatags.Text.all._
import scalatags.Text.{TypedTag, tags2}
import sqwl.cms.{Dashboard, ViewState, config, iContent}
object Categories extends config {
def apply(cnt: iContent, st: ViewState): Option[TypedTag[String]] =
st match {
case Dashboard => Some(tags2.section(
div(cls:="row",
cnt.categories.map(c =>
div(cls:="col-xs-6 col-sm-4 col-md-3",
div(cls:="tile-category",
a(href:=s"/${http.prefix}/${c.pathSegment}",
cls:="tile-category-body", c.name)))))
))
case _ => None
}
}