wf4/app/components/Blog/Category.vue
webfussel 0a481fee5e add: first post, external posts, new comps
Add first post for monday, add external posts from other authors, add components for internal and external links
2025-07-11 13:32:59 +02:00

25 lines
No EOL
553 B
Vue

<template>
<Icon :name="icon" mode="svg"/>
{{ name }}
</template>
<script setup lang="ts">
import type { Category } from './types'
type Props = {
name: Category
}
const { name } = defineProps<Props>()
const icons: Record<Category, string> = {
'story': 'ph:chat-circle-dots-duotone',
'snippet': 'ph:code-duotone',
'tutorial': 'ph:lightbulb-duotone',
'news': 'ph:newspaper-duotone',
'freelancing': 'ph:laptop-duotone',
'extern': 'ph:repeat-duotone',
}
const icon = computed(() => icons[name] ?? 'ph:question-mark-duotone')
</script>