<template>
  <ShareAddressBase
    :heading="$t('modals.receive.title', { name: protocolName })"
    :account-address="activeAccount.address"
    :protocol="activeAccount.protocol"
    :token-contract-id="tokenContractId"
    is-receive
    @close="resolve()"
  />
</template>

<script lang="ts">
import { defineComponent } from 'vue';
import { PROTOCOL_VIEW_TRANSFER_RECEIVE } from '@/constants';
import { useAccounts } from '@/composables';
import { ProtocolAdapterFactory } from '@/lib/ProtocolAdapterFactory';

import ShareAddressBase, { shareAddressRequiredProps } from '@/popup/components/Modals/ShareAddressBase.vue';

export default defineComponent({
  name: PROTOCOL_VIEW_TRANSFER_RECEIVE,
  components: {
    ShareAddressBase,
  },
  props: {
    ...shareAddressRequiredProps,
  },
  setup() {
    const { activeAccount } = useAccounts();

    return {
      activeAccount,
      protocolName: ProtocolAdapterFactory.getAdapter(activeAccount.value.protocol).protocolName,
    };
  },
});
</script>
