<script>
import { unique } from './utils'

export default {
  name: 'BiUserAvatarClusterItem',
  inject: ['UserAvatarCluster'],
  props: {
    name: {
      type: String,
      default: ''
    },
    src: {
      type: String,
      default: ''
    }
  },
  created() {
    this.id = unique()
    this.UserAvatarCluster.add({
      id: this.id,
      props: this.$props
    })
  },
  render() {
    return null
  },
  beforeDestroy() {
    this.UserAvatarCluster.remove(this.id)
  }
}
</script>
