<template>
  <b-field :label="label">
    <span class="has-text-dark pl-2" v-if="type == 'string'">{{value || "-"}}</span>
    <span class="has-text-dark pl-2" v-else-if="type == 'number'">{{value.NumberFormat() || "-"}}</span>
    <span class="has-text-dark pl-2" v-else-if="type == 'undefined'">{{"-"}}</span>
    <span class="has-text-dark pl-2" v-else-if="type == 'boolean'">
      {{(value)?$t('text.yes'):$t('text.no')}}
    </span>
    <span class="has-text-dark pl-2" v-else><i class="has-text-grey">{{$t('message.content_not_redered')}}</i></span>
  </b-field>
</template>

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