<script setup>
import { isExternal } from '~/utils/validate';

const props = defineProps({
  to: String
})
</script>


<template>
  <a v-if="isExternal(props.to)" :href="props.to" target='_balnk'>
    <slot></slot>
  </a>
  <router-link v-else :to="props.to">
    <slot></slot>
  </router-link>
</template>
