<!--
 This file is part of the Meeds project (https://meeds.io/).
 
 Copyright (C) 2020 - 2021 Meeds Association contact@meeds.io
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public
 License as published by the Free Software Foundation; either
 version 3 of the License, or (at your option) any later version.
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 Lesser General Public License for more details.
 
 You should have received a copy of the GNU Lesser General Public License
 along with this program; if not, write to the Free Software Foundation,
 Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-->
<template>
  <v-card flat>
    <h3 class="d-flex flex-nowrap">
      {{ $t('tradeDeeds') }}
      <v-divider class="my-auto ms-4" />
    </h3>
    <v-card-text class="ps-0" v-html="$t('tradeDeedsIntroduction', {0: openSeaLink, 1: openSeaTarget})" />
    <v-card-actions class="ps-0 justify-center">
      <a
        :href="openSeaLink"
        :title="$t('sellOnOpenSea')"
        :target="openSeaTarget">
        <img
          src="https://storage.googleapis.com/opensea-static/Logomark/Badge%20-%20Available%20On%20-%20Light.png"
          class="openSea-badge"
          alt="Available on OpenSea">
      </a>
    </v-card-actions>
  </v-card>
</template>
<script>
export default {
  computed: Vuex.mapState({
    openSeaCollectionLink: state => state.openSeaCollectionLink,
    openSeaLink() {
      return this.openSeaCollectionLink || 'javascript:void(0)';
    },
    openSeaTarget() {
      return this.openSeaCollectionLink && '_blank' || '';
    },
  }),
};
</script>