<template>
  <div class="icon-button">
    <el-button-group>
      <el-tooltip effect="dark" content="直播间内用户" placement="top" :enterable="false">
        <el-button type="success" size="small" disabled><icon-svg name="user" /></el-button>
      </el-tooltip>
      <el-tooltip effect="dark" content="管理回放" placement="top" :enterable="false">
        <el-button type="warning" size="small" disabled><icon-svg name="playback" /></el-button>
      </el-tooltip>
      <el-tooltip effect="dark" content="商品库" placement="top" :enterable="false">
        <el-button type="primary" size="small"
          @click="$router.push({ name: 'liveroomProd', params: { id: id.toString() } })">
          <icon-svg name="product" /></el-button>
      </el-tooltip>
      <el-tooltip effect="dark" content="客户咨询" placement="top" :enterable="false">
        <el-button type="primary" size="small" disabled><icon-svg name="question" /></el-button>
      </el-tooltip>
      <el-tooltip effect="dark" content="商品跳转记录" placement="top" :enterable="false">
        <el-button type="info" size="small" @click="$router.push(`/liveroom/liveroom-product-jump-record/${id}`)"><icon-svg name="record" /></el-button>
      </el-tooltip>
      <el-tooltip effect="dark" content="邀约码统计" placement="top" :enterable="false">
        <el-button type="info" size="small" disabled><icon-svg name="share" /></el-button>
      </el-tooltip>

      <el-tooltip effect="dark" content="查看" placement="top" :enterable="false">
        <el-button type="success" size="small" @click="$emit('display-detail', { id, index })"><icon-svg
            name="eye" /></el-button>
      </el-tooltip>
      <el-tooltip effect="dark" content="修改" placement="top" :enterable="false">
        <el-button type="primary" size="small" @click="handleEdit"><icon-svg name="pen" /></el-button>
      </el-tooltip>
      <el-tooltip effect="dark" content="删除" placement="top" :enterable="false">
        <el-button type="danger" size="small" @click="$emit('delete-room', { id, index })"><icon-svg
            name="trashcan" /></el-button>
      </el-tooltip>
    </el-button-group>
  </div>
</template>

<script lang="ts">
import Vue from 'vue'

export default Vue.extend({
  name: "operations",
  props: {
    id: {
      type: Number,
      required: true,
    },
    data: {
      type: Object,
      default: null,
    },
    index: {
      type: Number,
      default: 0,
    }
  },
  methods: {
    handleEdit() {
      this.$router.push({
        name: 'liveroomEdit',
        params: { id: this.id.toString() }
      })
    }
  }
})
</script>