
# dependencies
icons = require '@allenbrowntech/lemon-icons'

# template
module.exports = (items, options) ->
  div '#intro-bar', ->
    div '.items', ->
      for item in items
        item.url ?= item.link
        attrs = {class: 'item'}
        attrs.href = item.url if item.url
        attrs.style = "color: #{options.color}" if options?.color

        # url and icon and text
        if item.url? and item.icon? and item.text?
          a attrs, ->
            raw icons[item.icon]
            span -> item.text

        # url and icon
        else if item.url? and item.icon?
          a attrs, ->
            raw icons[item.icon]

        # url and text
        else if item.url? and item.text?
          a attrs, ->
            item.text

        # just icon
        else if item.icon?
          div attrs, ->
            raw icons[item.icon]

        # just text
        else if item.text?
          div attrs, ->
            item.text
