<template>
  <Link v-if="!!href && !!image" :inline="false" :href="href">
    <img :src="image" :alt="$_tr('altImageBlockImage')" />
  </Link>
</template>

<script>
import { Link } from 'inside-collection/components'

export default {
  name: 'HomeBlockImage',
  $_i18nRootPath: 'customs.HOMEPAGE.BLOCK_IMAGE',
  components: { Link },
  computed: {
    image() {
      return this.$store.getters.getInsideSettings(
        'homepage.blockImageBackground'
      )
    },
    href() {
      return this.$store.getters.getInsideSettings('homepage.blockImageLink')
    }
  }
}
</script>
