<script setup>
import { computed } from 'vue'
import { PushNote, GetNoteByName } from '~/services/Content';

const props = defineProps(['content'])

const parts = computed(() => props.content?.split('|') ?? [])

const href = computed(() => parts.value[0] || '')
const text = computed(() => parts.value[1] || parts.value[0] || '')


function handleClick() {
  // your custom logic here
  PushNote(GetNoteByName(href.value));
}


</script>

<template>
  <a href="#" @click.prevent="handleClick">
    {{ text }}
  </a>
</template>