<template>
  <window-size>
    <SelectCard to="patientCardInfo" v-if="!showEmpty" />
    <van-empty :image="empty" v-if="showEmpty" description="您还没有添加就诊人">
      <van-button type="primary" block @click="toAddCard"> 添加就诊人 </van-button>
    </van-empty>
  </window-size>
</template>

<script setup>
import store from '@/store'
import empty from '@/assets/empty.png'
import { computed } from 'vue'
import {useRouter} from "vue-router";
import SelectCard from "@/components/select-card/index.vue";

const router = useRouter()
const showEmpty = computed(() => {
  return !store.getters.alreadyHasCard
})
const toAddCard = () => {
  router.push('/addElectronicHealthCard')
}
</script>
