public/components/Tag.vue

27 lines
636 B
Vue
Raw Normal View History

2022-08-08 18:41:29 -04:00
<script setup lang="ts">
2024-10-16 13:25:13 -04:00
const { highlight } = defineProps<{
name: string;
2022-08-10 16:31:25 -04:00
dest: string;
highlight?: boolean;
}>();
// const isLinkableTag = !props.name.includes(" ");
const isLinkableTag = true;
const tagClass = [
2024-05-11 18:05:57 -04:00
"inline-block text-xs rounded-lg py-1 px-2 mt-1 mr-1 transition border border-pink-200 dark:border-pink-900 border-2 font-medium no-underline",
2024-10-16 13:25:13 -04:00
{ "bg-pink-200 dark:bg-pink-900": highlight },
{ "shadow-md": isLinkableTag },
];
2022-08-08 18:41:29 -04:00
</script>
<template>
2024-05-11 18:05:57 -04:00
<div :class="tagClass">
<a :href="dest" v-if="isLinkableTag">
{{ name }}
2024-05-11 18:05:57 -04:00
</a>
<div v-else>
{{ name }}
</div>
</div>
</template>