<template>
  <span v-if="isCut">{{ cutText }}</span>
  <span v-else class="thirdparty-text">
    <span class="firstname">{{ thirdparty.text }}</span>
  </span>
</template>

<script>
export default {
  name: "ThirdPartyText",
  props: {
    thirdparty: {
      required: true,
    },
    isCut: {
      type: Boolean,
      required: false,
      default: false,
    },
  },
  computed: {
    cutText: function () {
      let more = this.thirdparty.text.length > 15 ? "…" : "";
      return this.thirdparty.text.slice(0, 15) + more;
    },
  },
};
</script>
