wf4/app/components/Blog/Category.vue
webfussel 579491f216 add: category, date sorting
Add category layouts and date sorting
2025-07-11 13:32:59 +02:00

24 lines
No EOL
520 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',
}
const icon = computed(() => icons[name] ?? 'ph:question-mark-duotone')
</script>