<i18n>
{
  "en": {
  },
  "de": {
  }
}
</i18n>

<template>
  <v-data-table stlye="width: 100px"
    :headers="headers"
    :items="clients"
    item-key="id"
    hide-actions
    select-all
    v-model="selected"
  >
    <template slot="items" slot-scope="props">
      <tr @click="props.selected = !props.selected">
        <td class="narrow-td">
          <v-checkbox
            color="primary"
            v-model="props.selected"
            hide-details
            @click.native.stop
          ></v-checkbox>
        </td>
        <td class="narrow-td">{{ props.item.id }}</td>
        <td>{{ props.item.name }}</td>
        <td>{{ props.item.ip }}</td>
        <td>{{ props.item.mac }}</td>
        <td>{{ props.item.uuid }}</td>
        <td class="narrow-td">
          <v-btn icon @click.stop><v-icon color="primary">edit</v-icon></v-btn>
        </td>
      </tr>
    </template>
  </v-data-table>
</template>

<script>

export default {
  name: 'GroupModuleClientList',
  props: ['tabIndex'],
  data () {
    return {
      headers: [
        { text: 'ID', value: 'id' },
        { text: 'Name', value: 'name' },
        { text: 'IP Address', value: 'ip' },
        { text: 'MAC Address', value: 'mac' },
        { text: 'UUID', value: 'uuid' },
        { sortable: false }
      ],
      selected: []
    }
  },
  computed: {
    clients () {
      return this.$store.state.groups.groupChain[this.tabIndex].clients
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.narrow-td {
  width: 10px;
}
</style>
