<template>
  <RouterLink :to="action">
    <div class="list-item">
      <img v-bind:src="thumbnail"/>
      <div class="image-overlay">
        <span>{{ title }}</span>
      </div>
    </div>
  </RouterLink>
</template>

<script>
export default {
  name: 'ListItem',
  props: [
    'title',
    'thumbnail',
    'action'
  ]
}
</script>

<style scoped>
.list-item {
  margin: 8px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.list-item img {
  max-height: 512px;
  max-width: 512px;
  vertical-align: top;
}

.image-overlay {
  bottom: 0px;
  background-color: #eee;
  width: 100%;
  font-size: 1.5em;
  line-height: 3em;
  height: 3em;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.image-overlay span {
  margin: 4px;
}

a {
  text-decoration: none;
}
</style>
