<template>
  <tr>
    <td class="has-text-grey">
      <small>{{label}}</small>
    </td>
    <td>
      <span v-if="type == 'string'">{{value || "-"}}</span>
      <span v-else-if="type == 'number'">{{value.NumberFormat() || "-"}}</span>
      <span v-else-if="type == 'boolean'">
        {{(value)?$t('text.yes'):$t('text.no')}}
      </span>
      <span v-else>{{"-"}}</span>
    </td>
  </tr>
</template>

<script>
export default {
  name: 'LeanispTableFieldViewItem',
  props: ['label','value'],
  computed: {
    type () {
      return typeof this.value
    }
  }
}
</script>