<template>
  <div @click="clickAction(data, index)">
    <slot />
  </div>
</template>

<script>
import ResumeActionsMixin from './resume/mixins/resume-actions-mixin'

export default {
  name: 'SearchAction',
  mixins: [ResumeActionsMixin],
  props: {
    data: {
      type: Object,
      required: true
    },
    index: {
      type: Number,
      required: true
    }
  },

  created() {
    /*
     * Define all content types actions
     */
    this.actions = {
      documents: item => this.downloadFile(item),
      folders: item => this.foldersAction(item),
      users: item => this.usersAction(item),
      news: item => this.redirectAction(item),
      events: item => this.redirectAction(item),
      pages: item => this.redirectAction(item),
      tools: item => this.toolAction(item),
      jobs: item => this.jobAction(item)
    }
  }
}
</script>
