<template>
  <component-listing
    id="groups-tools-listing"
    :pagination="false"
    :fractions="1"
    :static-data="tools"
  >
    <template #default="{ item }">
      <Tool
        v-bind="{
          ...item,
          class: '',
          icon: getToolIcon(item)
        }"
        :key="item.uuid"
        display="minimal"
      />
    </template>
  </component-listing>
</template>

<script>
import Tool from '@inside-tools/components/lib/ToolItem'

export default {
  name: 'GroupsToolsListing',
  components: { Tool },
  props: {
    tools: {
      type: Array,
      required: true
    }
  },
  methods: {
    getToolIcon(item) {
      return item.class ? item.class.replace('sid2-', '') : ''
    }
  }
}
</script>
