{-# LANGUAGE NoImplicitPrelude #-}
module Bamboo.Theme.MiniHTML5.Control.Comment where
  
import Bamboo.Model.Comment (Comment)
import Bamboo.Theme.MiniHTML5.Env hiding (body, date, alt, create)
import qualified Bamboo.Theme.MiniHTML5.Atom.Comment as CommentVA

list :: [Comment] -> [Html]
list [] = []
list xs = 
  [ h2 ! [id "comments"] << "Responses"
  , olist ! [theclass "commentlist" ] 
    << xs.zip (cycle ["comments-alt", ""]).map (splash styled_entry)
  ]
  where
    styled_entry alt x = li ! [theclass alt] << x.CommentVA.entry

create :: State -> Comment -> Html
create = CommentVA.create