<script setup>
const props = defineProps({
  params: Object
})
// console.log(props?.params?.data?.orderSourceData)

</script>

<template>
  <div class="d-inlineFlex items-center gap-5px">
    <div class="tags">
<!--      <nuxt-link :to="`/sales/orders/${props.params.data.id}/edit`"> {{ props.params.data.documentNo }}</nuxt-link>-->
      <a v-if="props?.params?.data?.marketplaceKey === 'shopware6' && props.params.data.shopware6_order_id " target="_blank"
         :href="`${props?.params?.data?.orderSource?.Description}/${props.params.data.shopware6_order_id}/general`"><i
          class="i-mdi-link-variant mr-1 text-xs"></i>{{ props.params.data.externalorderId }}
        <span style="font-size: 14px !important; padding-bottom: 1px;" class="tf-icon ti ti-external-link ti-xs me-1 color-inherit"></span>
      </a>
      <a v-else-if="props?.params?.data?.marketplaceKey === 'shopify' && props.params.data.shopify_order_id" target="_blank" :href="`${props?.params?.data?.orderSource?.Description}/${props.params.data.shopify_order_id}`"><i class="i-mdi-link-variant mr-1"></i>{{props.params.data.externalorderId}}<span style="font-size: 14px !important; padding-bottom: 1px;" class="tf-icon ti ti-external-link ti-xs me-1 color-inherit"></span></a>
      <a v-else-if="props?.params?.data?.marketplaceKey === 'amazon' && props.params.data.amazon_order_id" target="_blank" :href="`${props?.params?.data?.orderSource?.Description}/${props.params.data.amazon_order_id}`">{{props.params.data.amazon_order_id}}  <span style="font-size: 14px !important; padding-bottom: 1px;" class="tf-icon ti ti-external-link ti-xs me-1 color-inherit"></span></a>
      <a v-else-if="props?.params?.data?.marketplaceKey === 'plentyone' && props.params.data.plentyone_order_id" target="_blank" :href="`${props?.params?.data?.orderSource?.Description}/plenty/terra/order/order-ui/${props.params.data.plentyone_order_id}`">{{props.params.data.plentyone_order_id}}<span style="font-size: 14px !important; padding-bottom: 1px;" class="tf-icon ti ti-external-link ti-xs me-1 color-inherit"></span></a>
<!--      https://p50692.my.plentysystems.com/plenty/terra/order/order-ui/82327-->
      <span v-else-if="props?.params?.data?.externalorderId">{{props?.params?.data?.externalorderId}}<span style="font-size: 14px !important; padding-bottom: 1px;" class="tf-icon ti ti-external-link ti-xs me-1 color-inherit"></span></span>
    </div>
  </div>
</template>

<style scoped>
.tag {
  width: 40px;
  height: 20px;
}
.greenbt {
  color: white;
  background-color: #00a500;
  border: 1px solid #00a500;
}

.greybt {
  color: grey;
  border: 1px solid grey;
}

.icons {
  color: white;
}

span[class^='i-mdi'] {
  font-size: 19px;
  margin-top: 4px;
}
</style>