Refactored some stuff

This commit is contained in:
Alexis
2025-03-30 16:48:30 +02:00
parent 637a5cd7e3
commit d4d74db5d9
16 changed files with 67 additions and 39 deletions

View File

@@ -0,0 +1,13 @@
<script setup lang="ts">
import type { Category } from "~/models/Category";
defineProps<{
category: Category
}>()
</script>
<template>
<UiButton variant="secondary" size="sm" class="w-full text-left">
{{ category }}
</UiButton>
</template>

View File

@@ -0,0 +1,15 @@
<script setup lang="ts">
import type { Category } from "~/models/Category";
defineProps<{
categories: Category[]
}>()
</script>
<template>
<ul>
<li v-for="category in categories" :key="category.id">
<CalendarCategoryItem :category="category" />
</li>
</ul>
</template>

View File

@@ -1,4 +1,5 @@
<script lang="ts" setup>
import { CalendarFormCategories } from "#components";
import { PhX } from "@phosphor-icons/vue";
const { toggleCategoriesModal } = useCalendar()
@@ -20,17 +21,23 @@ function handleClosing() {
@interact-outside="handleClosing"
@close-auto-focus="(e) => e.preventDefault()"
>
<UiAlertDialogTitle>
<span class="text-2xl">
<strong class="font-bold">Gestion des catégories</strong>
</span>
</UiAlertDialogTitle>
<header>
<UiAlertDialogTitle>
<span class="text-2xl">
{{ $t('entity.category.manageDialog.title') }}
</span>
</UiAlertDialogTitle>
<UiAlertDialogDescription>
{{ $t('entity.category.manageDialog.subtitle') }}
</UiAlertDialogDescription>
</header>
<UiButton size="icon" variant="ghost" class="absolute top-4 right-4" title="Fermer la fenêtre" @click="handleClosing">
<PhX size="20" />
</UiButton>
catégories
<CalendarFormCategories />
</UiAlertDialogContent>
</UiAlertDialog>
</template>

View File

@@ -0,0 +1,7 @@
<script lang="ts" setup>
const { categories } = storeToRefs(useCalendar())
</script>
<template>
<CalendarCategoryList :categories />
</template>

View File

@@ -5,7 +5,7 @@ import { useElementBounding } from "@vueuse/core"
import { storeToRefs } from "pinia"
import { computed, ref, type ComputedRef } from "vue"
import CalendarEventButton from "../../CalendarEvent.vue"
import CalendarEventButton from "../../event/Event.vue"
const props = defineProps<{
date: RPGDate