<template>
  <div class="bi-linkman-card">
    <div class="bi-linkman-card__user">
      <bi-user-portray
        :avatar="avatar"
        :show-avatar="showAvatar"
        :name="name"
      >
        <template slot="addon">
          <div class="bi-linkman-card__mobile" :title="mobile">{{mobile}}</div>
        </template>
      </bi-user-portray>
    </div>
    <div
      class="bi-linkman-card__addon"
      v-if="$slots.addon"
    >
      <slot name="addon"></slot>
    </div>
  </div>
</template>
<script>
import BiUserPortray from '@huntianning/components/packages/user-portray'

export default {
  name: 'UiLinkmanCard',
  components: {
    BiUserPortray
  },
  props: {
    avatar: {
      type: String
    },
    showAvatar: {
      type: Boolean,
      default: true
    },
    name: {
      type: String
    },
    mobile: {
      type: String
    }
  }
}
</script>
<style lang="less">
.bi-linkman-card{
  padding: 12px;
  border-radius: 4px;
  background-color: #F3F4F5;
}
.bi-linkman-card__mobile{
  color: #999;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bi-linkman-card__addon{
  border-top: 1px solid rgba(0,0,0,.05);
  padding-top: 12px;
  margin-top: 12px;
}
</style>
