<template>
      <div >
       <PluginEmbed
          :walletConnect="walletConnect"
          :instance="instance"
          :mode="mode"
          :entry="entry"
        />
    
      </div>
    </template>
    <script setup lang="ts">
    
    
    import { useWalletConnect } from "@cverse/core-connector-beta";
    import { watch, PropType,defineAsyncComponent } from "vue";
    import { Instance, Entry } from "@cverse/core-lib-vue-beta";
    import { PluginMode } from "@cverse/core-lib-beta";
    
    let { walletConnect, walletConnectRefresh } = useWalletConnect()
    import {Embed as PluginEmbed } from '@cverse/plugin-governance-beta/lib/embed'; 
    const props = defineProps({
      instance: {
        type: Instance
      },
      mode: {
        type: String as PropType<PluginMode>
      },
      entry: {
        type: Entry
      }
    })
    walletConnectRefresh();
    watch(() => props.instance, async ()=>{
      if(!walletConnect.walletAddress && window.walletConnect){
        walletConnect.value = window.walletConnect.value;
      }
    },{immediate:true,deep:true})
    </script>
    