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

# draw items helper
draw = (items) ->
  for item in items
    item.url ?= item.link

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

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

    # only text
    else if item.text?
      span -> item.text

# template
module.exports = (_) ->

  div "#footer", ->

    if _.right
      div '.right', ->
        draw _.right

    if _.center
      div '.center', ->
        draw _.center

    if _.left
      div '.left', ->
        draw _.left
