<template>
    <span style="font-size: 12px;"  class="float-right text-light py-2 badge badge-info">
     ({{initial_balance}} )
    </span>
</template>

<script>
  export default {
    props: ['id','initial_balance','initial_currency'],
    data: function () {
      return {
        balance: this.initial_balance
      }
    },
    mounted(){
      //this.listen();
    },
    methods: {
          listen(){
              Echo.private(`accounts.${this.id}`)
                  .listen('AccountUpdated',(e)=>{
                    this.balance = e.balance;
              });
          }
    },
    
  };
</script>