
h = require 'maquette' .h

Card = (key, head-left, head-content, content, on-click) ->
	self = {
		key: key
		head-left: head-left
		head-content: head-content
		content: content
		modal: void
	}

	self.render = ->
		h \div.card { key: self.key } [
			h \div.card-content [
				h \div.media [
					h \div.media-left [
						self.head-left
					]
					h \div.media-content [
						self.head-content
					]
				]

				h \div.content [
					self.title
					h \div.button {
						onclick: -> on-click!
					} [ "Edit" ]

					if self.modal
						self.modal.render!
				]
			]
		]

	self


module.exports = Card
