<template>
  <div
    class="
      collection_card
      flex
      text-font-white
      px-4
      py-6
      rounded-md
      shadow-sm
      bg-font-light-black
    "
  >
    <div class="left w-4/12 object-cover rounded-md">
      <img src="/img/cover.png" class="rounded-md" />
    </div>
    <div class="right w-8/12">
      <div class="w-full px-4">
        <div class=" text-lg">{{colletionData.name}}</div>

        <div class="mt-8">
          <div class="text-font-dark-blue">NFT编号</div>
            <p class=" break-words line-clamp-2   w-full text-2xs ">
            {{colletionData.nftId}}
            </p>
        </div>

        <div class="flex flex-wrap w-full text-sm mt-3">
          <div class="text-font-dark-blue">题材</div>
          <div class="flex-1 pl-3 flex gap-x-2" v-for='(i,index) in getThemeList' :key="index">
            <span>{{i}}</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
import Vue, { PropType } from "vue";
import {MyNFTItem} from '@/types/Dto'
export default Vue.extend({
  name: "CollectionCard",
  props: {
      colletionData:{} as PropType<MyNFTItem>
  },
  computed:{
    getThemeList():string | string[]{
        if(this.colletionData.theme){
            return  this.colletionData.theme.split(',')
        }
        return []

    }
  }
});
</script>

