<script setup>
import { computed } from "vue";
const props = defineProps({
  to: { type: String, required: false },
  href: { type: String, required: false },
  target: { type: String, required: false },
  underline: { type: Boolean, required: false }
});
const link = computed(() => props.href || props.to);
</script>

<template>
  <NuxtLink
    v-bind="link ? {
  href: link,
  target,
  rel: target === '_blank' ? 'noopener noreferrer' : void 0
} : {}"
    :class="{ 'n-link n-transition hover:n-link-hover n-link-base': link || underline }"
  >
    <slot />
    <div
      v-if="link && target === '_blank'"
      i-carbon:arrow-up-right translate-y--1 text-xs op50
    />
  </NuxtLink>
</template>
