Added category update

This commit is contained in:
Alexis
2025-04-06 14:41:46 +02:00
parent 8005a8e9a2
commit b32fab81f6
8 changed files with 281 additions and 89 deletions

View File

@@ -2,9 +2,13 @@
import type { Category } from "~/models/Category";
import { ScrollAreaRoot, ScrollAreaViewport, ScrollAreaScrollbar, ScrollAreaThumb } from "radix-vue"
defineProps<{
const { categories } = defineProps<{
categories: Category[]
}>()
const sortedCategories = computed(() => {
return categories.toSorted((a, b) => a.name.localeCompare(b.name))
})
</script>
<template>
@@ -23,7 +27,7 @@ defineProps<{
<ScrollAreaViewport class="w-full h-full pr-4" as-child>
<div class="[&:last-child]:border-0">
<CalendarCategoryTableRow
v-for="item in categories"
v-for="item in sortedCategories"
:key="item.id"
:category="item"
/>