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

<script lang="ts">
import { defineComponent } from 'vue';
import {
  PROTOCOLS,
  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 {
      protocol: PROTOCOLS.solana,
      activeAccount,
      protocolName: ProtocolAdapterFactory.getAdapter(PROTOCOLS.solana).protocolName,
    };
  },
});
</script>
