<template>
  <base-link
    :type="type"
    :id="id"
    :text="text"
    :path="path"
  />
</template>

<script>

import BaseLink from '@/components/Business/BaseLink.vue'
import { UserType } from '@/utils/constants'

export default {
  components: { BaseLink },
  props: {
    id: {
      type: String,
      default: null,
    },
    text: {
      type: String,
      default: null
    },
    type: {
      type: String,
      default: "link"
    }
  },
  computed: {
    path() {
      if (this.$store.getters.userType === UserType.APP) {
        return `/device/${this.id}`
      } else {
        return `/smDevice/device/${this.id}`
      }
    },
  }
}
</script>
