ADD: icons for RichTextLink

Hard coded RichTextLink icons
This commit is contained in:
webfussel 2025-02-21 19:52:07 +01:00
parent cc8e4eb1bd
commit 9a1b1acfee
4 changed files with 9 additions and 19 deletions

View file

@ -1,12 +1,14 @@
<template>
<a :href="href" :target="target" class="text inline-flex-row" :class="{ reverse : icon && icon.position === 'end' }">
<Icon v-if="icon" :name="icon.name" mode="svg" />
<a :href="href" :target="target" class="text inline-flex-row">
{{ content }}
<Icon :name="`ph:${linkIcon}-duotone`" mode="svg" />
</a>
</template>
<script setup lang="ts">
import type { RichTextLink } from './Types'
defineProps<RichTextLink>()
const { href } = defineProps<RichTextLink>()
const linkIcon = href.startsWith('http') ? 'globe' : 'arrow-square-in'
</script>